microsoft/typespec

Public

mirrored from https://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
e966efd30e552f4e84d5ae7224515199738ddd8e

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

packages/openapi3/src/types.ts

43lines · modecode

1export type ExtensionKey = `x-${string}`;
2
3export type Extensions = {
4 [key in ExtensionKey]?: any;
5};
6
7export interface OpenAPI3Discriminator extends Extensions {
8 propertyName: string;
9 mapping?: Record<string, string>;
10}
11
12export type JsonType = "array" | "boolean" | "integer" | "number" | "object" | "string";
13
14export type OpenAPI3Schema = Extensions & {
15 type: JsonType;
16 description?: string;
17 properties?: Record<string, any>;
18 required?: string[];
19 discriminator?: OpenAPI3Discriminator;
20
21 allOf?: any[];
22 anyOf?: any[];
23 oneOf?: any[];
24};
25
26export type OpenAPI3ParameterType = "header" | "query" | "path";
27export type OpenAPI3Parameter = Extensions & {
28 in: OpenAPI3ParameterType;
29 schema: OpenAPI3Schema;
30 name: string;
31 required?: boolean;
32 description?: string;
33};
34
35export type OpenAPI3Operation = Extensions & {
36 description?: string;
37 summary?: string;
38 responses?: any;
39 tags?: string[];
40 operationId?: string;
41 requestBody?: any;
42 parameters: OpenAPI3Parameter[];
43};
44