Skip to content
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

[REQ][cppqt] Support nullable integer fields #17756

Closed
martonmiklos opened this issue Jan 31, 2024 · 0 comments · Fixed by #17805
Closed

[REQ][cppqt] Support nullable integer fields #17756

martonmiklos opened this issue Jan 31, 2024 · 0 comments · Fixed by #17805

Comments

@martonmiklos
Copy link
Contributor

I need to work with an API (InvenTree) which specifies some fields as a nullable integer.

parent:
          type: integer
          nullable: true

This is modeling a relation where the null have a special meaning: no relation, and it is not identical to specifying 0.
Unfortunately with the current generated API I am unable to specify the fields as null.

Describe the solution you'd like

For these fields the openapi-codegen generates the following API members ():

    qint32 getParent() const;
    void setParent(const qint32 &parent);
    bool is_parent_Set() const;
    bool is_parent_Valid() const;

I would extend it with the following:

    qint32 getParent() const;
    bool isParentNull() const;
    void setParent(const qint32 &parent);
    void setParentNull();
    bool is_parent_Set() const;
    bool is_parent_Valid() const;

@etherealjoy: I seen you were the main author of the Qt stuff, I would glad to hear you opinion on this.

@martonmiklos martonmiklos changed the title [cppqt] Support nullable integer fields [REQ][cppqt] Support nullable integer fields Jan 31, 2024
martonmiklos added a commit to martonmiklos/openapi-generator that referenced this issue Feb 6, 2024
wing328 pushed a commit that referenced this issue Feb 23, 2024
* [cpp-qt-client]Allow nullable parameters

Fixes #17756

* Update samples
kota65535 pushed a commit to kota65535/openapi-generator that referenced this issue Feb 23, 2024
* [cpp-qt-client]Allow nullable parameters

Fixes OpenAPITools#17756

* Update samples
oscarr-reyes pushed a commit to oscarr-reyes/openapi-generator that referenced this issue Feb 25, 2024
* [cpp-qt-client]Allow nullable parameters

Fixes OpenAPITools#17756

* Update samples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant