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

Prism not working with array params in path #2289

Open
brendarearden opened this issue May 12, 2023 · 0 comments
Open

Prism not working with array params in path #2289

brendarearden opened this issue May 12, 2023 · 0 comments

Comments

@brendarearden
Copy link
Contributor

brendarearden commented May 12, 2023

Context

Using an array in the path param results in an internal server error

Current Behavior

When using an array path param, the follow error occurs:
Screenshot 2023-05-12 at 10 01 23 AM

Screenshot 2023-05-12 at 9 51 25 AM

Expected Behavior

It should parse correctly

Possible Workaround/Solution

Steps to Reproduce

minimum reproducible spec:

swagger: '2.0'
info:
  title: test-2.0
  version: '1.0'
host: 'localhost:3000'
schemes:
  - http
produces:
  - application/json
consumes:
  - application/json
paths:
  '/users/{userIds}':
    parameters:
      - type: array
        name: userIds
        in: path
        description: Array of additional Ids
        items:
          type: string
        required: true
    get:
      summary: Get User Info by User ID
      tags: []
      responses:
        '200':
          description: User Found
          schema:
            $ref: '#/definitions/User'
          examples:
            Get User Alice Smith:
              id: 142
              firstName: Alice
              lastName: Smith
              email: alice.smith@gmail.com
              dateOfBirth: '1997-10-31'
              emailVerified: true
              signUpDate: '2019-08-24'
        '404':
          description: User Not Found
          schema:
            type: 'null'
          examples: {}
      operationId: get-users-userId
      description: Retrieve the information of the user with the matching user ID.
      parameters: []
definitions:
  User:
    title: User
    type: object
    properties:
      id:
        type: integer
        description: Unique identifier for the given user.
      firstName:
        type: string
      lastName:
        type: string
      email:
        type: string
        format: email
      dateOfBirth:
        type: string
        format: date
        example: '1997-10-31'
      emailVerified:
        type: boolean
        description: Set to true if the user's email has been verified.
      createDate:
        type: string
        format: date
        description: The date that the user was created.
    required:
      - id
      - firstName
      - lastName
      - email
      - emailVerified
  1. run prism mock using provided spec
  2. attempt to make a mocked call
  3. see error

Environment

  • Version used:
  • Environment name and version (e.g. Chrome 39, node.js 5.4):
  • Operating System and version (desktop or mobile):
  • Link to your environment/workspace/project:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants