Skip to content

Show only the parts of a swagger document that you are interested in

License

Notifications You must be signed in to change notification settings

kjjuno/swagger-min

Repository files navigation

swagger-min

Platform Badges
License License MIT
Circle CI CircleCI
Code Coverage Code Coverage
Documantation Documentation Status
NPM npm version npm downloads
Docker Docker Size Docker Pulls

Show only the parts of a swagger document that you are interested in

install swagger-min from npm

npm install -g swagger-min

show relevant swagger for POST /pet from https://petstore.swagger.io

swagger-min --file https://petstore.swagger.io/v2/swagger.json --verb post --route /pet
paths:
  /pet:
    post:
      tags:
        - pet
      summary: Add a new pet to the store
      description: ''
      operationId: addPet
      consumes:
        - application/json
        - application/xml
      produces:
        - application/xml
        - application/json
      parameters:
        - in: body
          name: body
          description: Pet object that needs to be added to the store
          required: true
          schema:
            $ref: '#/definitions/Pet'
      responses:
        '405':
          description: Invalid input
      security:
        - petstore_auth:
            - 'write:pets'
            - 'read:pets'
definitions:
  Pet:
    type: object
    required:
      - name
      - photoUrls
    properties:
      id:
        type: integer
        format: int64
      category:
        $ref: '#/definitions/Category'
      name:
        type: string
        example: doggie
      photoUrls:
        type: array
        xml:
          name: photoUrl
          wrapped: true
        items:
          type: string
      tags:
        type: array
        xml:
          name: tag
          wrapped: true
        items:
          $ref: '#/definitions/Tag'
      status:
        type: string
        description: pet status in the store
        enum:
          - available
          - pending
          - sold
    xml:
      name: Pet
  Category:
    type: object
    properties:
      id:
        type: integer
        format: int64
      name:
        type: string
    xml:
        name: Category
  Tag:
    type: object
    properties:
      id:
        type: integer
        format: int64
      name:
        type: string
    xml:
        name: Tag

About

Show only the parts of a swagger document that you are interested in

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published