go-openapi / swag

goodie bag in use in the go-openapi projects
Apache License 2.0
184 stars 46 forks source link

fix(yaml): make MarshalYAML deterministic #76

Closed fredbi closed 10 months ago

fredbi commented 10 months ago

This PR sorts the keys of a map[string]interface{} before marshaling to YAML, similar to what the standard encoding/json does.

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (3f60c98) 86.45% compared to head (6a3638d) 86.88%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #76 +/- ## ========================================== + Coverage 86.45% 86.88% +0.43% ========================================== Files 12 12 Lines 1602 1609 +7 ========================================== + Hits 1385 1398 +13 + Misses 184 178 -6 Partials 33 33 ``` | [Flag](https://app.codecov.io/gh/go-openapi/swag/pull/76/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) | Coverage Δ | | |---|---|---| | [oldstable](https://app.codecov.io/gh/go-openapi/swag/pull/76/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) | `86.88% <100.00%> (+0.43%)` | :arrow_up: | | [stable](https://app.codecov.io/gh/go-openapi/swag/pull/76/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) | `86.88% <100.00%> (+0.43%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.