Skip to content

Latest commit

 

History

History
137 lines (110 loc) · 2.35 KB

example2.rst

File metadata and controls

137 lines (110 loc) · 2.35 KB

# structure

tree
examples/qualified-import
├── generated.yaml
├── main.yaml
└── parts
    ├── human-state.yaml
    ├── type.yaml
    └── verify-state.yaml

1 directory, 5 files
swagger-bundler bundle main.yaml > generated.yaml

qualified-import/main.yaml

x-bundler-namespace: My
x-bundler-compose:
  - parts/human-state.yaml as H
  - parts/verify-state.yaml as V

definitions:
  manager:
    type: object
    properties:
      name:
        type: string
      humanState:
        $ref: '#/definitions/HState'
      state:
        $ref: '#/definitions/VState'

qualified-import/parts/human-state.yaml

x-bundler-concat:
  - type.yaml

definitions:
  state:
    properties:
      type:
        $ref: "#/definitions/type"
      status:
        type: string
        enum:
          - hungry
          - angry
          - sad
          - happy
          - dead

qualified-import/parts/type.yaml

definitions:
  type:
    type: string
    enum:
      - active
      - inactive

qualified-import/parts/verify-state.yaml

x-bundler-compose:
  - type.yaml

definitions:
  state:
    properties:
      type:
        $ref: "#/definitions/type"
      status:
        type: string
        enum:
          - ok
          - ng

## generated.yaml

definitions:
  type:
    type: string
    enum:
    - active
    - inactive
  MyHState:
    properties:
      type:
        $ref: '#/definitions/type'
      status:
        type: string
        enum:
        - hungry
        - angry
        - sad
        - happy
        - dead
  MyVType:
    type: string
    enum:
    - active
    - inactive
  MyVState:
    properties:
      type:
        $ref: '#/definitions/MyVType'
      status:
        type: string
        enum:
        - ok
        - ng
  MyManager:
    type: object
    properties:
      name:
        type: string
      humanState:
        $ref: '#/definitions/MyHState'
      state:
        $ref: '#/definitions/MyVState'