8000 Sort paths and components in OpenApi by davidyuk · Pull Request #4330 · aeternity/aeternity · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Sort paths and components in OpenApi #4330

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

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

davidyuk
Copy link
Member

I've did it using yq + a manual change in the second commit.
Motivation is to improve a visual search performance 🙃

yq -i 'sort_keys(.components.schemas) | sort_keys(.components.parameters) | sort_keys(.paths) | .paths = (.paths | to_entries | sort_by(.value.*.tags[] == "internal") | from_entries)' ./apps/aehttp/priv/oas3.yaml
yq -i 'sort_keys(.definitions) | sort_keys(.paths) | .paths = (.paths | to_entries | sort_by(.value.*.tags[] == "internal") | from_entries)' ./apps/aehttp/priv/swagger.yaml

This PR is supported by the Æternity Foundation

Copy link
Contributor
@ThomasArts ThomasArts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified that the http client generated from oas3.yaml is identical for old and new code.

But I don't really get why this change is needed... there are tools to look at this file, so textual representation should not matter.

docker run -p 8300:8080 -v /.../Aeternity/aeternity/apps/aehttp/priv/:/app -e SWAGGER_FILE=/app/oas3.yaml -e URL_OAS3_GENERATOR=null -id swaggerapi/swagger-editor

@davidyuk
Copy link
Member Author

The endpoint list at https://api-docs.aeternity.io/ is also unordered 🤷‍♀️

@dincho
Copy link
Member
dincho commented Apr 16, 2024

The endpoint list at https://api-docs.aeternity.io/ is also unordered 🤷‍♀️

It is generated from the schema

@ThomasArts ThomasArts merged commit f7e04a6 into aeternity:master Apr 16, 2024
@davidyuk davidyuk deleted the feature/order-swagger branch April 21, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0