openapi: 3.0.0
info:
  version: '1'
  title: Modell API
  description: Das ultimative Modell API
servers:
  # Added by API Auto Mocking Plugin
  - description: SwaggerHub API Auto Mocking
    url: https://virtserver.swaggerhub.com/predic/modell/1
paths:
  /modelle/:
    post:
      tags: 
        - Modelle
      requestBody:
        $ref: '#/components/requestBodies/Modell'
      responses:
        201:
          description: Created
    get:
      tags: 
        - Modelle
      responses:
        200:
          description: Ok
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ModellItem'
  /modelle/{mid}:
    parameters:
      - name: mid
        in: path
        required: true
        schema: 
          type: integer
        
    get:
      tags: 
        - Modelle
      responses:
        200:
          $ref: '#/components/responses/Modell'
       
components:
  requestBodies:
    Modell:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Modell' 
  responses:
    Modell:
      description: Ok
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Modell'
  schemas:
    Modell:
      type: object
      properties:
        id:
          type: integer
          example: 11235
        name:
          type: string
          maxLength: 20
          example: Model 3
        werk:
          type: integer
          example: 42
    ModellItem:
      type: object
      properties:
        name:
          type: string
        self_uri:
          type: string
          format: uri
      example: 
        name: ID.3
        self_uri: /modelle/67