cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ygavish
New Member

cannot create a dynamic list that is depended on a parameter from another dynamic list inside a call’s body.

Hi,

I cannot create a dynamic list that is depended on a parameter from another dynamic list inside a call’s body.

As soon as I try it, I get an error:

Specified swagger has the following errors: 'Definition is not valid. Error: 'Error : paths/~1v1~1projects~1{project_id}~1cards~1create-new/post/parameters/1/schema/properties/planlet_id/x-ms-dynamic-values/parameters/board_id/parameter : The 'x-ms-dynamic-values' extension references properties within parameters. You need to define the 'x-ms-dynamic-list' extension. '

 

I could not find a way to make it work, would be great to have an example on how to fix it.

Inside a call's body have one parameter that is populated from a dynamic list and then a different dynamic list which is depended on the selected parameter from the previous dynamic list , and using the first parameter as an input to the new call.

 

Example:

 

board_id:

              type: integer

              format: int32

              description: board_id

              title: ''

              x-ms-dynamic-values:

                operationId: get_all_boards

                value-path: id

                value-title: name

                parameters:

                  project_id: {parameter: project_id}

              x-ms-visibility: important

 

label_id:

              type: integer

              description: label_id

              title: ''

              format: int32

              x-ms-dynamic-values:

                operationId: get_board_info

                value-path: id

                value-collection: labels

                value-title: name

                parameters:

                  board_id: {parameter: board_id}

              x-ms-visibility: advanced

 

Any help would be appreciated.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you Dmitry.

Making the body required and removing ItemsPath made it work.

View solution in original post

4 REPLIES 4
DmitriiKubyshev
Microsoft
Microsoft

Hi ygavish,

Please find this example from Connectors Open Source repository. There is exactly the same case when one property in the body references another one and both have dynamic values. One thing to notice is that x-ms-dynamic-list extension has a full path to a property (starting from parameter name) that is used as an input parameter.

Best regards,

Dmitrii

ygavish
New Member

Hi,

thank you for you answer. I was able to pass over the first problem. Now I can update the connector correctly. Selecting the first parameter works fine, however when I try to select the second It is not populated and I see "no items" instead. I know the server returns a correct answer.

 

Here is my swagger:

 

  /v1/external_notifications/0/hooks/set_power_hook:

    x-ms-notification-content:

      title: When a card is created

      description: Triggers when a card is created on the defined board

      schema:

        type: object

        properties:

          action: {type: string, description: Describes the action that triggered

              the event, title: Action}

          user: {type: string, title: User, description: The user who triggered the

              event}

          card_url: {type: string, title: Card Url, description: A link to the card

              URL}

          card_name: {type: string, title: Card Name, description: The name of the

              card}

          status: {type: string, title: Status, description: The current column the

              card is placed in}

          board_name: {type: string, title: Board Name, description: The name of the

              Board where the card lives}

          board_id: {type: integer, title: Board ID, description: The unique id of

              the board.}

          card_id: {type: integer, description: The unique ID of the card, title: Card

              ID, format: int32}

    post:

      responses:

        '200': {description: success}

      summary: When a card is created

      description: Triggers when a card is created on the defined board

      operationId: set_webhook_card_create

      x-ms-trigger: single

      parameters:

      - name: body

        in: body

        required: false

        schema:

          type: object

          properties:

            card_create:

              type: boolean

              default: true

              title: When a card is created

              description: Triggers when a card is created on the defined board

              enum: [true, false]

              x-ms-visibility: internal

            webhook: {type: string, description: webhook, x-ms-visibility: internal,

              title: '', x-ms-notification-url: true}

            project_id:

              type: string

              title: Project

              description: The id of the Project that the card belongs to

              x-ms-dynamic-values: {operationId: get_projects, value-path: project_id,

                value-collection: configs, value-title: project_name}

              x-ms-visibility: important

            board_id:

              type: integer

              format: int32

              title: Board

              description: The id of the Board that the card belongs to

              x-ms-dynamic-values:

                operationId: get_boards_by_project

                value-path: id

                value-title: name

                parameters:

                  project_id: {parameter: project_id}

              x-ms-dynamic-list:

                operationId: get_boards_by_project

                itemsPath: ''

                itemValuePath: id

                itemTitlePath: name

                parameters:

                  project_id: {parameterReference: body/project_id}

              x-ms-visibility: important

          required: [webhook, card_create, board_id]

 

 

 

Hi ygavish,

Do you have a schema or an example of a response from 'get_boards_by_project' operation? if it is just an array of objects with 'id' and 'name' properties, please try to remove 'itemsPath' property from 'x-ms-dynamic-list' definition. Also, please make 'body' parameter as required since it contains required properties.

Best regards,

Dmitry

Thank you Dmitry.

Making the body required and removing ItemsPath made it work.

View solution in original post

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (46,192)