Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide options for unexploded parameters #12

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

asein-sinch
Copy link
Collaborator

@asein-sinch asein-sinch commented Jan 24, 2024

The OAS documents are not specifying the arrays of query parameters correctly:

  • in Numbers (List active numbers)
        - name: capability
          in: query
          description: Number capabilities to filter by, `SMS` and/or `VOICE`.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string

==> The server accepts capability=SMS;VOICE (mind the semicolon)
==> The server rejects capability=SMS,VOICE (mind the comma): "message": "parsing field "capability": "SMS,VOICE" is not a valid value",
==> The server rejects capability=SMS&capability=VOICE: "message": "too many values for field "capability": SMS, VOICE",

  • in conversation
    update_mask.paths:
      description: The set of field mask paths.
      name: update_mask.paths
      in: query
      explode: true
      schema:
        type: array
        items:
          type: string

==> The server accepts update_mask=channel_priority,channel_identities,display_name

Both specifications are incorrect as it should be exploded: false and the first one is even more incorrect as the parameters should be coma-separated.
Reference: https://swagger.io/docs/specification/serialization/

@asein-sinch asein-sinch requested a review from a team January 24, 2024 14:40
@JPPortier
Copy link

JPPortier commented Jan 24, 2024

About comment

The server accepts capabilities=SMS;VOICE (mind the semicolon)

But ?regionCode=US&type=LOCAL&capabilities=SMS&capabilities=VOICE
Is accepted by server and conform to https://swagger.io/docs/specification/serialization for explode=true and form=true with query parameters
image

@asein-sinch
Copy link
Collaborator Author

I've update the description with the right operation that causes some issues. Sorry for the confusion

Copy link

@JPPortier JPPortier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree about OAS inconsitency.
For numbers and list operation: available vs active
Both are described as array / form / explode
but when requesting with multiple values :

  • active response: INVALID_ARGUMENT: too many values for field "capability": SMS, VOICE
  • available response: 200 / OK and response is filled

@asein-sinch asein-sinch requested a review from JPPortier February 7, 2024 13:25
@asein-sinch asein-sinch merged commit b81e3eb into main Feb 7, 2024
2 checks passed
@asein-sinch asein-sinch deleted the feature/provide-options-for-unexploded-parameters branch February 7, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants