IBM Support

LI80524: THE EXAMPLE GENERATOR DOES NOT CORRECTLY HANDLE EXAMPLES FOR ALLOF PROPERTY

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The API Connect developer portal is not displaying properly the
    request/response examples for API with types defined in swagger
    with allof property.
    Steps to reproduce:
    Create a API with the following content and publish it to the
    Portal:
    ----
    swagger: '2.0'
    info:
    x-ibm-name: test-cards
    title: TEST Cards
    version: 1.0.3
    description: ''
    schemes:
    - https
    host: $(catalog.host)
    basePath: /test-cards/v1
    consumes:
    - application/json
    produces:
    - application/json
    securityDefinitions:
    clientIdHeader:
      type: apiKey
      in: header
      name: X-IBM-Client-Id
    security:
    - clientIdHeader: []
    x-ibm-configuration:
    testable: true
    enforced: true
    cors:
      enabled: true
    assembly:
      execute:
       - invoke:
         title: invoke
         timeout: 60
         verb: POST
         cache-response: protocol
         cache-ttl: 900
         stop-on-error: []
         version: 1.0.0
         target-url: 'https://httpbin.org/post'
      catch: []
    phase: realized
    paths:
    /testop:
      post:
       responses:
        '200':
         description: 200 OK
         schema:
          $ref: '#/definitions/testprop'
       parameters:
        - name: test
         required: false
         in: body
         schema:
          $ref: '#/definitions/testprop'
    definitions:
    codeType:
      description: Code Type
      type: string
    stringType:
      description: String type
      type: string
    testprop:
      properties:
       test1:
        allOf:
         - $ref: '#/definitions/codeType'
        description: test
        type: string
        minLength: 2
        maxLength: 2
        example: CO
       test2:
        allOf:
         - $ref: '#/definitions/stringType'
        description: test
        type: string
        minLength: 2
        maxLength: 35
        example: TOTO
      additionalProperties: false
    tags: []
    ------
    When we request the body parameter example to be generated we
    expect something like
    {
    "test1": "CO",
    "test2": "TOTO"
    }
    instead we get:
    {
    "test1": {
      "0": "h",
      "1": "i",
      "2": "f",
      "3": "e",
      "4": "p",
      "5": "i"
    },
    "test2": {
      "0": "v",
      "1": "o",
      "2": "n",
      "3": "j"
    }
    }
    

Local fix

  • No
    

Problem summary

  • Examples were not correctly generated for objects using allOf
    

Problem conclusion

  • The example attribute is now correctly honored for definitions
    using allOf.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI80524

  • Reported component name

    API CONNECT ENT

  • Reported component ID

    5725Z2201

  • Reported release

    508

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2019-01-10

  • Closed date

    2019-02-01

  • Last modified date

    2019-02-01

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    API CONNECT ENT

  • Fixed component ID

    5725Z2201

Applicable component levels

  • R508 PSY

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSMNED","label":"IBM API Connect"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"508","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
29 September 2021