Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Order of Methods #520

Open
fritterhoff opened this issue Mar 30, 2022 · 3 comments
Open

Better Order of Methods #520

fritterhoff opened this issue Mar 30, 2022 · 3 comments

Comments

@fritterhoff
Copy link

If I generate a json from an openapi3.T the order of the Paths/Methods is pretty unusal (DELETE comes before GET). From my point of view this is caused due to the lexical order so Delete is serialized before Get and Post.

Is there maybe a way/... the serialize the spec in the "usual" order?

@ilteoood
Copy link
Contributor

I think that it depends on how Go organize maps.

Btw, +1 here: it should be awesome to have an order.

@fritterhoff
Copy link
Author

@ilteoood Wouldn't it be sufficient to manually serialize the PathItem struct in the correct order? From my pont of view the PathItem is the only point where it is really annoying.

func (pathItem *PathItem) MarshalJSON() ([]byte, error) {
return jsoninfo.MarshalStrictStruct(pathItem)
}

@fenollp
Copy link
Collaborator

fenollp commented Apr 1, 2022

cc #47 and also #37 also #98 (comment) and #241 This as well would benefit from a different (de)serialization: #485
also #513

Reworking de/serialization is on my TODO but I'm open to ideas / suggestions / PRs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants