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
  • #7751
Closed
Open
Issue created Oct 19, 2020 by Administrator@rootContributor3 of 6 checklist items completed3/6 checklist items

[BUG][cpp-restsdk] Numbers without dots (integers) are not converted to double

Created by: tzickel

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?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Trying to use the cpp-restsdk client generator I have a few issues. I'll write them in order of importance:

  1. If I define a property as a type number, format double, it will only accept JSON numbers with dot, and not parse integers!!. The csharp-nancyfx server encodes 0 as 0 and not 0.0 which ofcourse causes this not to work. I guess the ModelBase for float/double should need a check for double casting and if not, than int casting.

  2. The modelbase seems to ignore required flags in the model, and in the situation above it will put NaNs in the model instead of erroring that not all required fields have been set (in this case it's a bug, bug in other cases where it can't convert?). The ok result of fromJson should be checked, and an exception raised if the required fields have been specified ?

  3. The new CMake modifications for this client for some reason declare the model/modules header files as private and require manual addition of them in the client that uses the autogen code, is that a mistake ? (why would I want to use this generated code, if not to use it's header files, and those I don't want I can disable in generation part ?) Make them non-private in the cmake script ?

openapi-generator version

master

OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix

Written above.

Assignee
Assign to
Time tracking