[BUG] isRestful flags are always returning false
Created by: dstotz
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
Have you tested with the latest master to confirm the issue still exists? -
Have you searched for related issues/PRs? -
What's the actual output vs expected output?
Description
When generating a new client from a valid OpenAPI 3 spec, the isRestful, isRestfulCreate, isRestfulShow, isRestfulUpdate, etc.. flags are always false in Mustache template. I have tried with several generators and seem to have the same issue with each one I tried. We need to modify the templates based on if the request is a GET, or a PUT/POST and it looks like since the templates are logicless, the only way to do that is to use the boolean isRestful flags. Please let me know if I am misunderstanding these flags or if there is a workaround to my issue.
openapi-generator version
4.3.1
, 5.0.0beta1
, 5.0.0beta2
all installed with npm install -g
OpenAPI declaration file content or url
https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/petstore.yaml
Steps to reproduce
Run openapi-generator generate -i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml -g ruby --global-property=debugOperations
and you will see that all endpoints/requests are set to "isRestful" : false
even though they seem like they should all be true and that the POST request should be "isRestfulCreate" : true
and GET should be `isRestful
Suggest a fix
I would expect all get, post, put, delete endpoints to set the isRestful flag as well as their more specific isRestfulCreate, isRestfulUpdate, etc... flag