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

Fix field order in yaml generated OAS file #3084

Merged
merged 1 commit into from Dec 21, 2022

Commits on Dec 21, 2022

  1. Fix field order in yaml generated OAS file

    Today, the field order in swagger.json files is consistent with
    the actual order of fields in the .proto messages.
    (i.e. not by protobuf index/tag and not alphabetically sorted, but
    actually in the same order inside the protobuf)
    
    However, in swagger.yaml files the order becomes alphabetical due to
    automatic map[string]interface{} ordering in yaml marshaling.
    This gives less control over generated documentation (Redoc) from
    those yaml files.
    
    This commit uses yaml.Node introduces in yaml.v3 to keep the same
    field order in yaml generated files as well.
    same-id committed Dec 21, 2022
    Copy the full SHA
    c6b0aad View commit details
    Browse the repository at this point in the history