-
Notifications
You must be signed in to change notification settings - Fork 2
Fix the generator for optional body parameters #69
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
Conversation
lib/patch_ruby/api/orders_api.rb
Outdated
| def place_order(order_id, opts = {}) | ||
| place_order_request = Patch::PlaceOrderRequest.new(opts) | ||
| opts[:place_order_request] = place_order_request | ||
| data, _status_code, _headers = place_order_with_http_info(order_id, opts) | ||
| def place_order(place_order_request = {}, opts = {}) | ||
| _place_order_request = Patch::PlaceOrderRequest.new(place_order_request) | ||
| data, _status_code, _headers = place_order_with_http_info(_place_order_request, opts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should not be happening 😢
|
|
||
| # Creates a GLEC air shipping estimate given freight mass and logistics | ||
| # Creates a GLEC air shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. | ||
| # Creates a GLEC air shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the bug in the template that was escaping those values.
| # @return [OrderResponse] | ||
| def place_order(order_id, opts = {}) | ||
| place_order_request = Patch::PlaceOrderRequest.new(opts) | ||
| opts[:place_order_request] = place_order_request | ||
| data, _status_code, _headers = place_order_with_http_info(order_id, opts) | ||
| def place_order(id, opts = {}) | ||
|
|
||
| data, _status_code, _headers = place_order_with_http_info(id, opts) | ||
| data | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version had (most likely) be written manually. The new one is entirely generated by the templates.
| let(:instance_hash) { { project_id: @instance.project_id, mass_g: @instance.mass_g, total_price_cents_usd: @instance.total_price_cents_usd, metadata: @instance.metadata } } | ||
| let(:nullable_properties) do | ||
| Set.new(%i[mass_g total_price_cents_usd project_id metadata state vintage_year total_price currency amount unit issued_to]) | ||
| Set.new(%i[mass_g total_price_cents_usd project_id metadata state vintage_year total_price currency amount unit]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to change this line because of the new swagger file, but don't think this matters.
|
|
||
| # Creates a GLEC air shipping estimate given freight mass and logistics | ||
| # Creates a GLEC air shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. | ||
| # Creates a GLEC air shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also fixed this escaping in the generator.
What
swagger.jsonfile to define theissued_toparameter (leading to better file name)Why
Notes
SDK Release Checklist