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

Errors can be declared globally and route per route #150

Merged
merged 2 commits into from
Jul 23, 2024
Merged

Conversation

EwenQuim
Copy link
Member

@EwenQuim EwenQuim commented Jul 22, 2024

Fixes #127

Please see the golden file for OpenAPI changes :)

examples/full-app-gourmet/server/server.go Outdated Show resolved Hide resolved
examples/full-app-gourmet/views/views.go Outdated Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
@dylanhitt
Copy link
Collaborator

Per @ccoVeille suggestions why not just add:

https://golangci-lint.run/usage/linters/#usestdlibvars

to our golangci-lint config?

Copy link
Collaborator

@dylanhitt dylanhitt left a comment

Choose a reason for hiding this comment

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

Small things. Feel free to disregard.

This is an awesome feature and the interface seems to feel natural

openapi_operations_test.go Show resolved Hide resolved
openapi_operations.go Show resolved Hide resolved
@ccoVeille
Copy link
Collaborator

Per @ccoVeille suggestions why not just add:

https://golangci-lint.run/usage/linters/#usestdlibvars

to our golangci-lint config?

I'm afraid usestdlibvars won't detect this.

https://golangci-lint.run/usage/linters/#usestdlibvars

Also, there is way to configure it yet to tell him this int in this method is an http.Status

But, adding the linter is indeed a great thing.

@EwenQuim
Copy link
Member Author

EwenQuim commented Jul 23, 2024

Thank you again @ccoVeille and @dylanhitt for your very valuable comments. I resolved all you comments and I'll merge this PR.

Let's ship v0.14 now ! 🔥

@EwenQuim EwenQuim merged commit b5b67ae into main Jul 23, 2024
5 checks passed
@EwenQuim EwenQuim deleted the errors-openapi branch July 23, 2024 10:51
@dylanhitt
Copy link
Collaborator

Per @ccoVeille suggestions why not just add:
https://golangci-lint.run/usage/linters/#usestdlibvars
to our golangci-lint config?

I'm afraid usestdlibvars won't detect this.

https://golangci-lint.run/usage/linters/#usestdlibvars

Also, there is way to configure it yet to tell him this int in this method is an http.Status

But, adding the linter is indeed a great thing.

Oh I see, it only works in the context of the stdlib. It's actually already enabled for this project btw.

@ccoVeille
Copy link
Collaborator

Exactly, it would have been reported otherwise.

One way to detect them in the context of the methods this project use is to set up forbiddigo rules.

It would work

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

Successfully merging this pull request may close these issues.

openapi spec for non 200 responses
3 participants