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

openapi-types: better autocomplete with ParamsObject in v3 #883

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions packages/openapi-types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,32 @@ export namespace OpenAPIV3 {
url: string;
}

export interface ParameterObject extends ParameterBaseObject {
export type ParameterObject = PathLocationObject | QueryLocationObject | CookieLocationObject | HeaderLocationObject;

export interface CookieLocationObject extends ParameterBaseObject {
name: string;
in: string;
in: "cookie";
style?: "form";
}

interface HeaderLocationObject extends ParameterBaseObject {
name: string;
in: "header";
style?: "simple";
}

interface PathLocationObject extends ParameterBaseObject {
name: string;
in: "path";
required: boolean;
style?: "matrix" | "label" | "simple";
}

interface QueryLocationObject extends ParameterBaseObject {
name: string;
in: "query";
style?: "form" | "spaceDelimited" | "pipeDelimited" | "deepObject";
}

export interface HeaderObject extends ParameterBaseObject {}

export interface ParameterBaseObject {
Expand Down