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
  • #14688
Closed
Open
Issue created Feb 14, 2023 by Administrator@rootContributor4 of 6 checklist items completed4/6 checklist items

[BUG] Inline model schema's name is wrong

Created by: davidediak

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

When we have 2 operations (where operation = HTTP VERB + PATH) with the same path e.g.

GET path/{id}
PATCH path/{id}

and

  1. the GET response body schema is just a reference to a well defined schema (e.g. GenericDTO)
  2. the PATCH request body is an inline schema

you''ll have, in the openAPI's components, these 2 schemas:

  1. GenericDTO
  2. ApiV1PathIdGetRequest

the second schema 's name is wrong, it should instead be ApiV1PathIdPatchRequest

Sorry for not providing a spec to reproduce, I fixed it working against my day job's swagger.

Will try, eventually if I find the time, to create a spec in my free time.

openapi-generator version

6.4.0-SNAPSHOT

OpenAPI declaration file content or url

JSON spec

Generation Details

On master run ./run-in-docker.sh mvn package ./run-in-docker.sh generate -i spec.json -g typescript-angular --global-property models

You'll get 2 interfaces:

apiV1CustomerIdGetRequest.ts
customerResponse.ts

the first file name is wrong, it should be called apiV1CustomerIdPatchRequest.ts since it's the inline schema for the patch 's requestBody

Steps to reproduce
Related issues/PRs
Suggest a fix
Assignee
Assign to
Time tracking