Skip to content

Conversation

@vincentbernat
Copy link
Contributor

RFC 9512 deprecates application/x-yaml in favor of application/yaml. This PR changes that in Gin, with two commits:

  1. accepts application/yaml for bindings
  2. uses application/yaml when rendering

The second one may be considered as a breaking change, hence the separate commit.

RFC 9512 defines application/yaml as the official YAML MIME type.
application/x-yaml is deprecated. In this commit, we ensure it is
recognized correctly in Content-Type.
As per RFC 9512, application/x-yaml is now deprecated and applications
should use application/yaml. This commit fix the Content-Type header
when rendering YAML.
@appleboy appleboy added this to the v1.10 milestone Mar 5, 2024
@codecov
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.36%. Comparing base (3dc1cd6) to head (85f9380).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3851      +/-   ##
==========================================
+ Coverage   99.21%   99.36%   +0.15%     
==========================================
  Files          42       43       +1     
  Lines        3182     2676     -506     
==========================================
- Hits         3157     2659     -498     
+ Misses         17        9       -8     
  Partials        8        8              
Flag Coverage Δ
?
-race ∅ <ø> (?)
-tags "sonic avx" 99.35% <100.00%> (?)
-tags go_json 99.35% <100.00%> (?)
-tags nomsgpack 99.35% <100.00%> (?)
go-1.18 99.28% <100.00%> (+0.16%) ⬆️
go-1.19 99.36% <100.00%> (+0.15%) ⬆️
go-1.20 99.36% <100.00%> (+0.15%) ⬆️
go-1.21 99.36% <100.00%> (+0.15%) ⬆️
go-1.22 99.36% <100.00%> (?)
macos-latest 99.36% <100.00%> (+0.15%) ⬆️
ubuntu-latest 99.36% <100.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@appleboy appleboy changed the title Add support for RFC 9512: application/yaml chore(header): Add support for RFC 9512: application/yaml Mar 5, 2024
@appleboy appleboy merged commit 9c61295 into gin-gonic:master Mar 5, 2024
@appleboy
Copy link
Member

appleboy commented Mar 5, 2024

@vincentbernat Thanks.

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.

2 participants