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

[Bug] Unable to generate workflow from OpenAPI file with reusable request parameters #18

Open
chalu opened this issue Apr 20, 2024 · 0 comments

Comments

@chalu
Copy link

chalu commented Apr 20, 2024

I don't know if this is related to #4 , but I had just discovered StepCI and was trying it out to generate a workflow file from my OpenAPI 3.0 spec and I encountered errors from the stepci CLI

Error: TypeError: Cannot read properties of undefined (reading 'default')
Caused By: trying to access default in param.schema.default around line 75 of plugin-openapi/index.js

This is as a result of having reusable parameters in my API spec like below 👇🏽

/characters:
    get:
      ...
      parameters:
        - $ref: '#/components/parameters/JobTypeQueryParam'
        - $ref: '#/components/parameters/SortOnQueryParam'
        - $ref: '#/components/parameters/SortDirQueryParam'
        - $ref: '#/components/parameters/PageQueryParam'
        - $ref: '#/components/parameters/CharacterNameQueryParam'
     ...

components:
  parameters:
    ...
    PageQueryParam:
      in: query
      name: page
      description: For a paginated response, the page of the matching data to fetch. Defaults to `1`
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 1
        example: 2

Is this being looked into, seeing that issue #4 is dating back to October 2022?

Thanks

@chalu chalu changed the title Unable to generate workflow from OpenAPI with reusable request parameters [Bug] Unable to generate workflow from OpenAPI with reusable request parameters May 1, 2024
@chalu chalu changed the title [Bug] Unable to generate workflow from OpenAPI with reusable request parameters [Bug] Unable to generate workflow from OpenAPI file with reusable request parameters May 1, 2024
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

No branches or pull requests

1 participant