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
  • #7142
Closed
Open
Issue created Aug 06, 2020 by Administrator@rootContributor4 of 6 checklist items completed4/6 checklist items

[BUG] [Python] arrays validation problems for maxItems/minItems

Created by: SapMaria

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

Validation rules are not added for lists (maxItems/minItems values) to the generated Python SDK (I tested only for Python).

I also tried to add validation rules for string, number and integer. It's ok.

openapi-generator version

4.3.1 (additionaly checked on latest 5.0.0-beta)

OpenAPI declaration file content or url
requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                os:
                  type: object
                  required:
                    - name
                    - version
                  properties:
                    name:
                      type: string
                    version:
                      type: string
                packages:
                  type: array
                  minItems: 1
                  maxItems: 5
                  items:
                    type: string
Generation Details
java -jar openapi-generator-cli-4.3.1.jar generate  -i v1.yaml -g python -o ~/projects/sdk-openapi
Steps to reproduce

Just use generator script with default options for python.

Related issues/PRs

Not found.

Assignee
Assign to
Time tracking