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

Broken swagger:response Generation with Go 1.22.0 + 1.21.5 darwin/arm64 #3071

Closed
kvizdos opened this issue Feb 9, 2024 · 2 comments
Closed

Comments

@kvizdos
Copy link

kvizdos commented Feb 9, 2024

Problem statement

I've been trying to get Swagger running for a few hours now. I can't seem to get responses working at all. Using code directly from the example page (https://goswagger.io/use/spec/response.html):

// A ValidationError is an error that is used when the required input fails validation.
// swagger:response validationError
type ValidationError struct {
    // The error message
    // in: body
    Body struct {
        // The validation message
        //
        // Required: true
        // Example: Expected type int
        Message string
        // An optional field name to which this validation applies
        FieldName string
    }
}

And building with swagger generate spec -o ./swagger.yaml (also tried swagger generate spec -o ./swagger.yaml --scan-models), I get this output:

responses:
    validationError:
        description: A ValidationError is an error that is used when the required input fails validation.

No amount of anything seems to fix this from what I've tried.

Any help would be greatly appreciated!

Environment

swagger version: v0.30.5 (I've tried static builds + homebrew)
go version: 1.22.0 + 1.21.5
OS: darwin/arm64

@kvizdos
Copy link
Author

kvizdos commented Feb 9, 2024

Also tried Docker, couldn't get it working. Hit way too many issues worth my time, already spent wayyy to long trying to get this working.

@kvizdos kvizdos closed this as completed Feb 10, 2024
@kvizdos
Copy link
Author

kvizdos commented Feb 10, 2024

Moved to #3035

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant