-
Notifications
You must be signed in to change notification settings - Fork 414
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
[REQUEST] Support OpenAPI 3.0 Links #685
Labels
Milestone
Comments
Yes please! |
backpackerhh
added a commit
to backpackerhh/challenge-be-safebox-api-rails
that referenced
this issue
Feb 26, 2024
The endpoint is configured with the minimum code required to know that all the pieces are working as expected. Nothing has been implemented at this moment, so it is currently returning a status 200 and an empty body. Following the approach suggested by the people from Codely, I'll use a dedicated directory, apps, for all the possible code using the bounded contexts instead of using the default app directory. I rather prefer having more flexibility with that code, mainly due to the way the code is autoloaded within the default directory. The endpoints are namespaced with the version of the API. Regarding the naming of the controllers, I'm using a more semantic name, as I'll use a controller for each endpoint, instead of adding all endpoints in a single controller. The ID of the safebox will be provided from the client instead of autogenerated in the database. References: * https://guides.rubyonrails.org/autoloading_and_reloading_constants.html * https://github.com/fxn/zeitwerk * https://swagger.io/docs/specification/links/ * https://github.com/rswag/rswag * rswag/rswag#685 * https://github.com/rswag/rswag/blob/master/rswag-specs/lib/rswag/specs/request_factory.rb#L204 * rswag/rswag#359 * https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NestedGroups * https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass * https://www.youtube.com/watch?v=wR5b0OhbUyw
backpackerhh
added a commit
to backpackerhh/challenge-be-safebox-api-rails
that referenced
this issue
Feb 26, 2024
The endpoint is configured with the minimum code required to know that all the pieces are working as expected. Nothing has been implemented at this moment, so it is currently returning a status 200 and an empty body. Following the approach suggested by the people from Codely, I'll use a dedicated directory, apps, for all the possible code using the bounded contexts instead of using the default app directory. I rather prefer having more flexibility with that code, mainly due to the way the code is autoloaded within the default directory. The endpoints are namespaced with the version of the API. Regarding the naming of the controllers, I'm using a more semantic name, as I'll use a controller for each endpoint, instead of adding all endpoints in a single controller. The ID of the safebox will be provided from the client instead of autogenerated in the database. References: * https://guides.rubyonrails.org/autoloading_and_reloading_constants.html * https://github.com/fxn/zeitwerk * https://swagger.io/docs/specification/links/ * https://github.com/rswag/rswag * rswag/rswag#685 * https://github.com/rswag/rswag/blob/master/rswag-specs/lib/rswag/specs/request_factory.rb#L204 * rswag/rswag#359 * https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NestedGroups * https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass * https://www.youtube.com/watch?v=wR5b0OhbUyw
backpackerhh
added a commit
to backpackerhh/challenge-be-safebox-api-rails
that referenced
this issue
Feb 28, 2024
The endpoint is configured with the minimum code required to know that all the pieces are working as expected. Nothing has been implemented at this moment, so it is currently returning a status 200 and an empty body. Following the approach suggested by the people from Codely, I'll use a dedicated directory, apps, for all the possible code using the bounded contexts instead of using the default app directory. I rather prefer having more flexibility with that code, mainly due to the way the code is autoloaded within the default directory. The endpoints are namespaced with the version of the API. Regarding the naming of the controllers, I'm using a more semantic name, as I'll use a controller for each endpoint, instead of adding all endpoints in a single controller. Also suggested by Codely, the ID of the safebox will be provided from the client instead of being autogenerated in the database (check video below). The main difference is in the endpoint itself, as they prefer to use the endpoint to update the resource because the ID is already known. I can see it, but here I stick with the classic endpoint (POST method). References: * https://guides.rubyonrails.org/autoloading_and_reloading_constants.html * https://github.com/fxn/zeitwerk * https://swagger.io/docs/specification/links/ * https://github.com/rswag/rswag * rswag/rswag#685 * https://github.com/rswag/rswag/blob/master/rswag-specs/lib/rswag/specs/request_factory.rb#L204 * rswag/rswag#359 * https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NestedGroups * https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass * https://www.youtube.com/watch?v=wR5b0OhbUyw * https://www.youtube.com/watch?v=P3bpYv9vdic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
The OpenAPI 3.0 standard adds a new "links" field to responses to link to other APIs.
Describe the solution you'd like
The documentation generator supports this, and it works if you manually populate
metadata[:response][:links]
, so I think there just needs to be a wrapper method added toexample_group_helpers
What support could we give you, so you could implement this yourself?**
If this sounds reasonable to you, I'll just add it
Relates to which version of OAS (OpenAPI Specification)
The text was updated successfully, but these errors were encountered: