question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicated schemas in parsed result

See original GitHub issue

Related issue: https://github.com/OpenAPITools/openapi-generator/issues/2701


Specs that reproduces the issue

  • openapi.yaml
openapi: 3.0.0
info:
  title: Common Data Types
  version: "1.0"
paths:
  /subscriptions:
    get:
      summary: read all of the active subscriptions for the app.
      operationId: getSubscriptionsById
      parameters:
        - name: appId
          in: path
          description: App ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK (Successful)
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Subscription'
        '500':
          $ref: './common.yaml#/components/responses/E500'  
components:
  schemas:
      ProblemDetails:
        type: object
        properties:
          title:
            type: string
            description: A short, human-readable summary of the problem
          status:
            type: integer
            description: The HTTP status code for this occurrence of the problem.
      Subscription:
        type: string
  • common.yaml
openapi: 3.0.0
info:
  title: Common Data Types
  version: "1.0"
paths: {}
components:
  responses:
    E500:
      description: Server Error
      content:
        application/json:
          schema:
            $ref: './openapi.yaml#/components/schemas/ProblemDetails'

Test codes which shows the issue

  • OpenAPIV3ParserTest.java
    @Test
    public void fooBar() {
        String location = "src/test/resources/xxx/openapi.yaml";
        OpenAPIV3Parser parser = new OpenAPIV3Parser();

        OpenAPI result = parser.read(location);
    }

The result has a duplicated schema ProblemDetails_2.

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
schlagi123commented, Apr 1, 2020

I tested the two examples from @ackintosh and @jphorx and they work. Please close the issue.

0reactions
gracekarinacommented, Apr 1, 2020

yes that is true!, we solve the duplication issue, thanks for pointing this here! @ackintosh please test and in case the issue is no longer happening please close. fixed by #1343

Read more comments on GitHub >

github_iconTop Results From Across the Web

Myth Busting: Will Duplicate Schema Tags Hurt Your SEO?
Schema can result in warnings and errors, and one of the most common errors is having duplicate tags. Let's discuss whether or not...
Read more >
JSON-LD Frame: Forcing duplication of redundant properties ...
Is it possible to force the duplication of redundant properties values, such as author and creator ? The goal is to reduce later...
Read more >
Copying schemas - IBM
Use the db2move utility with the -co COPY action to copy a single schema or multiple schemas from a source database to a...
Read more >
pandas.DataFrame.to_json — pandas 1.5.2 documentation
orient='table' contains a 'pandas_version' field under 'schema'. ... result = df.to_json(orient="split") >>> parsed = json.loads(result) ...
Read more >
Duplicate property names in JSON objects in Power Automate
To make this object maker-friendly, the common approach is to use Parse JSON action and derive schema from the data itself.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found