Skip to content

Swagger parameters not working with Dredd #866

Closed
@belrion

Description

@belrion

Hi,

I am trying to use a simple GET command with a variable to represent a value on the URI and run this swagger.yml file through Dredd.

` paths: /jobs/{id}: get: tags: - job summary: Finds the status of a job using jobid description: Job id from a previously submitted DA job can be used to find its status parameters: - name: id description: job id type: string in: path required: true responses: '200': description: successful operation schema: type: object properties: jobId: type: string tasks: type: array items: properties: id: type: integer taskType: type: string taskStatus: type: string createdTime: type: string `

When I run through Dredd, it complains that parameter id has no example or default value.
error: Compilation error in file 'swagger.yml': Required URI parameter 'id' has no example or default value. (job > /driveprocessing/v1/jobs/{id} > GET)

However, when I try to add a default value, which is contradicting, Dredd complains:
warn: Compilation warning in file 'swagger.yml': Required URI parameter 'id' has a default value.
Default value for a required parameter doesn't make sense from API description perspective. Use example value instead. (job >/driveprocessing/v1/jobs/{id} > GET)

and then it skips running the test case.
skip: GET /driveprocessing/v1/jobs/1ba10167-4560-4973-bd92-db9a747571f5

Question:
How do I specify a value for the id when running the swagger.yml through Dredd?

Thanks,
Chi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions