API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  APIC validation ISSUE

    Posted Mon January 06, 2025 01:05 AM

    in below swagger document , i put the header.ebmCID field to be required and it appears as required in swagger UI , but my problem is when i import the swagger file to intiate an API on APIC IBM APIC raises an error and can't see the field and raises an exception , so i have to delete the required field from the swagger and upload it again on APIC 
    then i want to use a validate node and makes the same field required via the UI of APIC 
    the validate node doesn't see it in the request i send via postman if i send the field **testRequest.header.ebmCID** in the request or not it raises a validation error via APIC 

    swagger: "2.0"
    info:
      description: "test API "
      version: "1.0.0"
      title: "test"
    host: "api.example.com"
    basePath: "/v1"
    schemes:
      - "https"
    paths:
      /test:
        post:
          summary: "testRequest"
          description: "testRequest"
          consumes:
            - "application/json"
          produces:
            - "application/json"
          parameters:
            - in: "body"
              name: "body"
              description: "test"
              required: true
              schema:
                $ref: "#/definitions/testRequest"
          responses:
            200:
              description: "Successful response"
              schema:
                $ref: "#/definitions/QueryParametersResponse"
            '500':
              description: internal server error
              schema:
               $ref: '#/definitions/FaultResponse'
            '404':
              description: not found
              schema:
               $ref: '#/definitions/NotFoundResponse'
            '501':
              description: Server Error Response
              schema:
               $ref: '#/definitions/ServerErrorResponse'
            '422':
              description: Server Error Response
              schema:
               $ref: '#/definitions/BusinessRuleViolationResponse'           
            '423':
              description: Server Error Response
              schema:
               $ref: '#/definitions/ValidationErrorResponse'  

    definitions:
      testRequest:
        type: object
        properties:
          queryParamters:
            type: object
            properties:
              header:
                $ref: "#/definitions/header"
              body:
                $ref: "#/definitions/Body"
        required:
          - queryParamters
      header:
        type: object
        properties:
          ebmCID:
            type: string
          userID:
             type: string
        required:
          -  ebmCID       



    ------------------------------
    Ahmed Elaimy
    ------------------------------