0
votes

I have the swagger API description (yaml / v 3.0) as stated below. I get the error Structural error at paths./AanwezigLeden/Aanmelden.post.requestBody.content.application/json.schema should NOT have additional properties additionalProperty: allOff

What I want is an API description of a post method with an object as specified oper_aanwezig_leden, with one additional field as body.

    /AanwezigLeden/Aanmelden:
        post:
          summary: Aanmelden van het lid als aanwezig. 
          requestBody:
            description: Lid data
            required: true
            content:
              application/json:
                schema:
                  allOff:
                  - ref: '#/components/schemas/oper_aanwezig_leden' 
                  - type: string
                    name: TIJDSTIP
                    description: Tijdstip van de aanmelding. Indien afwezig, huidige tijd. ISO8601
                    required: false
          responses:
            200:
              description: "OK, data succesvol aangepast"
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/oper_aanwezig_leden' 
            401:
              description: "Niet geautoriseerd, geen schrijfrechten"  
            404:
              description: "Data niet gevonden"        
            405:
              description: "Methode niet toegestaan, input validatie error"  
            406:
              description: "Niet aanvaardbaar, input ontbreekt"            
            500:
              description: "Data verwerkingsfout, bijv onjuiste veldwaarde (string ipv integer)" 
1
Typo: allOff -> allOf - Helen

1 Answers

1
votes

This triggered me for solving the issue. However, there is more than a typo

  /AanwezigLeden/Aanmelden:
    post:
      summary: Aanmelden van het lid als aanwezig. 
      requestBody:
        description: Lid data
        required: true
        content:
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/oper_aanwezig_leden_in' 
              - type: object
                properties:
                  TIJDSTIP:
                    description: Tijdstip van de aanmelding. Indien afwezig, huidige tijd. ISO8601
                    type: string
                    format: date-time 
                    example: "2017-07-21T09:32:28Z"