Skip to content

Path parameters #29

Closed
Closed
@Tijs-2

Description

@Tijs-2

Hi Rob,

I am looking at the generated openapi.json file and I am not sure it is correct.
I think this because a client that I generate from the openapi.json file cannot use the Path Parameters.

If I am correct I need to specify a path parameter like this:
@Get("/animal/:id") public Animal getOne(Long id)

But then it generates a openapi.json file like this:
"paths" : { "/animal/one/:id" : { "get" : { "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], },
It looks correct but I think that the generated path should look like this: "/animal/one/{id}" when I follow the documentation:
https://swagger.io/docs/specification/describing-parameters/
Also when I look at the client I generated with the dart generator it needs the {} around the parameters.

An example from the generated client is like this:
String path = "/animal/one/:id".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString());

Kind regards,
Tijs

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions