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

[BUG][Rust] Fields that should be nullable aren't Option #2337

Closed
tecywiz121 opened this issue Mar 8, 2019 · 4 comments
Closed

[BUG][Rust] Fields that should be nullable aren't Option #2337

tecywiz121 opened this issue Mar 8, 2019 · 4 comments

Comments

@tecywiz121
Copy link
Contributor

Description

The Rust generator output String when I think it should have output Option<String> in the model.

openapi-generator version

4.0.0-beta2

OpenAPI declaration file content or url
openapi: "3.0.0"
info:
  version: 0.0.0
  title: Bug Report
paths:
  /:
    get:
      responses:
        '200':
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Pages"
components:
  schemas:
    Pages:
      required:
        - next
      properties:
        next:
          type: string
          nullable: true
Command line used for generation

openapi-generator generate -i bug-report.yml -g rust -o bug-report

Steps to reproduce

Generate the client library.

Related issues/PRs

#2269
#1766

@auto-labeler
Copy link

auto-labeler bot commented Mar 8, 2019

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@wing328
Copy link
Member

wing328 commented Mar 10, 2019

What about using the {{#isNullable}}...{{/isNullable}} mustache tag to to include Option<...>??

@tecywiz121
Copy link
Contributor Author

Something like that?

@wing328
Copy link
Member

wing328 commented Mar 10, 2019

Yup, that should work as we've implemented it in other generators. Let us know if you need help filing a PR. Thanks for your contribution.

tecywiz121 added a commit to tecywiz121/openapi-generator that referenced this issue Mar 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants