Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #7726
Closed
Open
Issue created Oct 15, 2020 by Administrator@rootContributor5 of 5 checklist items completed5/5 checklist items

[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

Assignee
Assign to
Time tracking