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

Override SnakeYAML output ordering for OpenAPI documents #1545

Closed
tjquinno opened this issue Mar 19, 2020 · 2 comments · Fixed by #1593
Closed

Override SnakeYAML output ordering for OpenAPI documents #1545

tjquinno opened this issue Mar 19, 2020 · 2 comments · Fixed by #1593
Assignees
Labels
1.x Issues for 1.x version branch 2.x Issues for 2.x version branch open-api P3

Comments

@tjquinno
Copy link
Member

Environment Details

  • Helidon Version: 1.4.3, 2.x
  • Helidon SE or Helidon MP: n/a
  • JDK version: n/a
  • OS: n/a
  • Docker version (if applicable): n/a

SnakeYAML serializes its output in an indeterminate order. While this is valid according to specs, it is very inconvenient for human readers.

There might be ways of overriding the SnakeYAML ordering. This issue is to track that investigation.

@tjquinno tjquinno added open-api 1.x Issues for 1.x version branch 2.x Issues for 2.x version branch labels Mar 19, 2020
@tjquinno tjquinno self-assigned this Mar 19, 2020
@tjquinno
Copy link
Member Author

tjquinno commented Mar 19, 2020

This posting has a possible way of accomplishing this. Need to see if it still works and whether adding this amount of code would make sense to resolve the ordering problem.

https://stackoverflow.com/questions/31534014/keep-tags-order-using-snakeyaml

[update] It seems as if the existing SnakeYAML code base has adopted the suggestion in the above post.

@m0mus m0mus added the P3 label Mar 19, 2020
@tjquinno
Copy link
Member Author

Tomas and I agree that, when we have seen this, we do not remember the elements within an app or a path (which most directly represents an endpoint) being indeterminate. Tomas is certain he has seen endpoints grouped by app rearranged by app apparently indeterminately.

My quick research into the SnakeYAML code shows the use of ordered maps, not just HashMaps for example, so SnakeYAML seems to preserve property ordering.

There might be something going on inside SmallRye or in how Helidon presents different apps to SmallRye for annotation processing. Still looking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x Issues for 1.x version branch 2.x Issues for 2.x version branch open-api P3
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants