Skip to content

api/templates: align with go-swagger v1.32.3#51168

Merged
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:align_swagger_templates
Oct 11, 2025
Merged

api/templates: align with go-swagger v1.32.3#51168
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:align_swagger_templates

Conversation

@thaJeztah
Copy link
Member

api/templates: align with go-swagger v1.32.3

Align our custom templates with the one from upstream; https://github.com/go-swagger/go-swagger/tree/v0.32.3/generator/templates

  • Add "TODO" comments in places where we applied patches to make it easier to compare with upstream, and to see where differences are intentional.
  • Update the server/operations.gotmpl template;
    • Add the "generated" header in the right place, so that it's recognized as generated file.
    • Add back the upstream template code; instead of removing the code, put a "if false" block around it; this allows comparing our forked templates with upstream when updating the version of go-swagger (to make sure we're not missing fixes).

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

Align our custom templates with the one from upstream;
https://github.com/go-swagger/go-swagger/tree/v0.32.3/generator/templates

- Add "TODO" comments in places where we applied patches to make it
  easier to compare with upstream, and to see where differences are
  intentional.
- Update the server/operations.gotmpl template;
  - Add the "generated" header in the right place, so that it's
    recognized as generated file.
  - Add back the upstream template code; instead of removing the
    code, put a "if false" block around it; this allows comparing
    our forked templates with upstream when updating the version
    of go-swagger (to make sure we're not missing fixes).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Comment on lines +1 to +6
// Code generated by go-swagger; DO NOT EDIT.

package image

// ----------------------------------------------------------------------------
// Code generated by `swagger generate operation`. DO NOT EDIT.
// Code generated by `swagger generate operation`.
Copy link
Member Author

Choose a reason for hiding this comment

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

This properly adds the "generated" header

@thaJeztah
Copy link
Member Author

Thanks Rob!

@thaJeztah thaJeztah merged commit 11e1368 into moby:master Oct 11, 2025
223 of 224 checks passed
@thaJeztah thaJeztah deleted the align_swagger_templates branch October 11, 2025 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants