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
  • #126
Closed
Open
Issue created May 22, 2018 by Administrator@rootContributor

[PHP] Handle non-required property as nullable

Created by: fMads

Description

When a property isn't required, it is not shown in Doc Block, that the getter can actually return "null". Also it is not shown in the setter, that "null" is a valid value

Swagger-codegen version

3.0.0-SNAPSHOT

Swagger declaration file content or url
  /path
    post:
      parameters:
        - in: body
          required: true
          name: objectName
          schema:
            type: object
            required:
              - requiredPropertyName
            properties:
              requiredPropertyName:
                type: string
              notRequiredPropertyName:
                type: string
Suggest a fix/enhancement

Change returnType in Doc Block for getters to correctly show, that the returned value can be null (if the property is not required). Also shown in Doc Block for setters, that value can be null (if property is not required)

Assignee
Assign to
Time tracking