Closed
Conversation
Use a recent go-swagger version instead of the outdated fork based on swagger-go from 2016. Remove usage of `--skip-validator` flag as it was dropped in 2018 (go-swagger PR 1353). Signed-off-by: Paweł Gronowski <[email protected]>
Due to the `--skip-validators` no longer being supported in the upstream swagger-go, this also adds a bunch of validation methods to the generated types. Signed-off-by: Paweł Gronowski <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
Replaced an outdated fork of
go-swagger(based on some version from 2016) with a recent upstream version.The recent version fixes the lack of
omitemptyfor thex-nullablefields (see #47526 (comment)).However, there's one catch...
Old version did have a
--skip-validatorswitch which turned off generation of theValidatemethod for the generated models. It has been removed somewhere around 2018 and is no longer available in the recent version.While not harmful, we don't make any use of these validators, so they're only bloating our api definitions and requiring more dependencies in our api package:
Restoring this option is pretty straightforward, as the generator backend already has an option for that.
See: vvoland/go-swagger@0448fe8
If we want to skip generating these, we should:
- How to verify it
CI
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)