-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Include path parameters and path as string type in the Paths section #406
Comments
@iansan5653 The OpenAPI v3 Spec: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#operationObject |
I don't use OpenAPI at the moment so I'm speaking from memory, but here's an example from an old project of an endpoint with a path parameter: {
"/events/{eventId}/attendees": {
"get": {
"summary": "...",
"tags": ["events"],
"operationId": "getAttendees",
"parameters": [
{
"name": "eventId",
"in": "path",
"description": "...",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "List of attendees",
"content": {
"application/json": {
"schema": {
"$ref": "#..."
}
}
}
}
}
}
}
} In this case, there's a string path parameter called I think with the |
@iansan5653,
|
When you build a TypeScript service that uses the types, you will eventually need to use the path to query the endpoints. Without the path at a string literal in the types, there's no way to ensure it's correct. For example:
I'm actually not sure of the best way to do it with path parameters. Maybe just provide the raw string type (ie |
The
Paths
section of the output file is structured like:However,
Parameters
there only includes query parameters (ie,endpoint?PARAMETER_NAME
), not path parameters (ieendpoint/{PARAMETER_NAME}
). Also there's no information about the endpoint itself.I propose adding to the existing structure:
Where
PathParameters
is the same structure asParameters
andEndpoint
is a string literal.The text was updated successfully, but these errors were encountered: