Skip to content

Commit 3a2c22b

Browse files
Copied compiler's metadata to typescript-generated.
1 parent 6bb1db7 commit 3a2c22b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

typescript-generator/src/metamodel.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,19 @@ export class Interface extends BaseType {
260260
variants?: Container
261261
}
262262

263+
/**
264+
* The Example type is used for both requests and responses
265+
* This type definition is taken from the OpenAPI spec
266+
* https://spec.openapis.org/oas/v3.1.0#example-object
267+
* With the exception of using String as the 'value' type
268+
*/
269+
export class Example {
270+
summary?: string
271+
description?: string
272+
value?: string
273+
external_value?: string
274+
}
275+
263276
/**
264277
* A request type
265278
*/
@@ -288,6 +301,7 @@ export class Request extends BaseType {
288301
body: Body
289302
behaviors?: Behavior[]
290303
attachedBehaviors?: string[]
304+
examples?: Map<string, Example>
291305
}
292306

293307
/**
@@ -300,6 +314,7 @@ export class Response extends BaseType {
300314
behaviors?: Behavior[]
301315
attachedBehaviors?: string[]
302316
exceptions?: ResponseException[]
317+
examples?: Map<string, Example>
303318
}
304319

305320
export class ResponseException {

0 commit comments

Comments
 (0)