Forum Discussion

Mango_LearnToUserF5's avatar
Jan 04, 2024

Advance WAF on F5 Doesn't support Open API version 3. Mismatch when import Swagger to F5 for APi Sec

Dear team,

As i checking with some F5 Engineer in my country, they say that even latest OS version of F5 only support Open API Swagger version 2. And now, when my company build a new applicaction based on Backbase, they use Open API version 3.0.3 for those API spec. It leads to some problem when import API Spec to create APi Security. For example, i have this API Spec.

  /client-api/repositories/{repositoryId}/upload:
    description: Uploading content to specified repository. it is the replacement
      of /upload/form endpoint.
    post:
      tags:
      - ContentUpload
      description: Performs uploading of content
      operationId: handleContentUpload
      parameters:
      - name: repositoryId
        in: path
        description: ID of the repository to save and/or update uploaded content items.
        required: true
        style: simple
        explode: false
        schema:
          type: string
          example: null
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DocumentUpload'
      responses:
        "200":
          description: Document successfully created and/or updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
              example:
                $ref: '#/components/examples/UploadResponseExample'
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusMessage'
        "403":
          description: File threat detected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusMessage'
        "404":
          description: Object not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusMessage'

    DocumentUpload:
      title: Document upload
      required:
      - file
      - name
      - targetPath
      type: object
      properties:
        targetPath:
          type: string
          description: Path where the item should be added.
          example: null
        file:
          type: string
          description: File to upload.
          format: binary
          example: null
        name:
          type: string
          description: File name.
          example: null
        cmis:objectTypeId:
          type: string
          description: Document Object Type ID property.
          example: null
          enum:
          - cmis:document
        cmis:createdBy:
          type: string
          description: Document created by property.
          example: null
        cmis:lastModifiedBy:
          type: string
          description: Document last modified by property.
          example: null
        bb:title:
          type: string
          description: Document title property.
          example: null
        bb:locale:
          type: string
          description: Document locale property.
          example: null
        changeToken:
          type: string
          description: Document change token property.
          example: null
        createSignedUrl:
          title: Create Signed URL for content after its creation
          type: boolean
          description: "If storage type supports generation of signed url for given\
            \ content, setting this to true will generate a signed url for a limited\
            \ time."
          example: null
          default: false
      example: null



When import to F5, F5 device can't understand and create param like targetPath, file, name, etc. And even when i try to add those properties to request body like below f5 still can't understand:

  /client-api/repositories/{repositoryId}/upload:
    description: Uploading content to specified repository. it is the replacement
      of /upload/form endpoint.
    post:
      tags:
      - ContentUpload
      description: Performs uploading of content
      operationId: handleContentUpload
      parameters:
      - name: repositoryId
        in: path
        description: ID of the repository to save and/or update uploaded content items.
        required: true
        style: simple
        explode: false
        schema:
          type: string
          example: null
      requestBody:
        content:
          multipart/form-data:
            schema:
              title: Document upload
              required:
                - file
                - name
                - targetPath
            type: object
            properties:
              targetPath:
                type: string
                description: Path where the item should be added.
                example: null
                file:
                  type: string
                  description: File to upload.
                  format: binary
                  example: null
                name:
                  type: string
                  description: File name.
                  example: null
                cmis:objectTypeId:
                  type: string
                  description: Document Object Type ID property.
                  example: null
                  enum:
                    - cmis:document
                cmis:createdBy:
                  type: string
                  description: Document created by property.
                  example: null
                cmis:lastModifiedBy:
                  type: string
                  description: Document last modified by property.
                  example: null
                bb:title:
                  type: string
                  description: Document title property.
                  example: null
                bb:locale:
                  type: string
                  description: Document locale property.
                  example: null
                changeToken:
                  type: string
                  description: Document change token property.
                  example: null
                createSignedUrl:
                  title: Create Signed URL for content after its creation
                  type: boolean
                  description: "If storage type supports generation of signed url for given\
                    \ content, setting this to true will generate a signed url for a limited\
                    \ time."
                  example: null
                  default: false
              example: null

 

But when importing an API like this, F5 can understand and create corresponding param.

  /client-api/v5/ext/message-center/messages:
    summary: Manage messages for user support request
    description: Manage messages for user support request
    post:
      tags:
        - message-center-ext-client
      summary: Create a root message of a conversation for user support request.
      description: Create a root message of a conversation for user support request.
      operationId: postCustomMessages
      parameters:
        - name: sendSupportRequestParameters
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/SendSupportRequestParameters'
      requestBody:
        description: Upload list file
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  description: The file to be uploaded contains one or more batches
                    according to any structured format known by the implementing service.
                  items:
                    type: string
                    description: The file to be uploaded contains one or more batches
                      according to any structured format known by the implementing service.
                    format: binary
                    nullable: true
                    default: ''
                  minItems: 0
                  maxItems: 5

Properties files is created on F5 with this Spec, what is the different and How should i edit the first Spec so F5 can understand. Please help advice.

2 Replies