Skip to content

Flatten changes case on definitions #2334

@rodriguise

Description

@rodriguise

Problem statement

When using swagger flatten to resolve remote specs into a single output, the resolved type names are changed to lowercase.

The case should be preserved.

Swagger specification

2.0

Steps to reproduce

  1. Create a spec (foo.yaml)
paths: 
   /bar:
      get:
         responses:
            200:
                 description: OK
                 schema:
                      $ref: "./bar.yaml#/definitions/Bar"
  1. Create a second spec (bar.yaml)
paths: {}

definitions:
   Bar:
      type: object
      properties:
         Baz:
            type: string
  1. Flatten

swagger flatten
-o flat.yaml --format=yaml foo.yaml

  1. Check flat.yaml
paths: 
   /bar:
      get:
         responses:
            200:
                 description: OK
                 schema:
                      $ref:: "#/definitions/bar
definitions:
   bar:  <---- why the case change????
      type: object
      properties:
         Baz:
            type: string

Environment

swagger version: v0.24.0
go version: 1.14.1
OS: Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions