0

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 Commented Dec 22, 2020 at 19:21

1 Answer 1

1

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"   
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.