Skip to content

path-query

Id
@typespec/openapi3/path-query

The OpenAPI v3 specification requires query parameters to be defined separately from the path. A @route whose path embeds a query string (e.g. /users?filter={filter}) cannot be represented and results in an error.

Keep the @route path free of query parameters and declare them with @query, or use a URI template such as /users{?filter}.

@route("/users?filter={filter}")
op getUsers(filter: string): User[];
@route("/users")
op getUsers(@query filter?: string): User[];