@scalar/openapi-types 0.2.3 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/openapi-types.d.ts +2 -11
- package/dist/openapi-types.d.ts.map +1 -1
- package/dist/openapi-types.js +1 -16
- package/dist/openapi-types.js.map +3 -3
- package/dist/openapi-types.test-d.js.map +2 -2
- package/dist/schemas/3.1/processed/index.d.ts +1 -1
- package/dist/schemas/3.1/processed/index.d.ts.map +1 -1
- package/dist/schemas/3.1/processed/index.js.map +2 -2
- package/dist/schemas/3.1/processed/openapi-object.d.ts +30835 -22
- package/dist/schemas/3.1/processed/openapi-object.d.ts.map +1 -1
- package/dist/schemas/3.1/processed/openapi-object.js +1 -1
- package/dist/schemas/3.1/processed/openapi-object.js.map +2 -2
- package/dist/schemas/3.1/unprocessed/index.d.ts +1 -1
- package/dist/schemas/3.1/unprocessed/index.d.ts.map +1 -1
- package/dist/schemas/3.1/unprocessed/index.js.map +2 -2
- package/dist/schemas/3.1/unprocessed/openapi-object.d.ts +22 -23
- package/dist/schemas/3.1/unprocessed/openapi-object.d.ts.map +1 -1
- package/dist/schemas/3.1/unprocessed/openapi-object.js +55 -1
- package/dist/schemas/3.1/unprocessed/openapi-object.js.map +2 -2
- package/dist/schemas/3.1/unprocessed/paths-object.d.ts +2268 -265
- package/dist/schemas/3.1/unprocessed/paths-object.d.ts.map +1 -1
- package/dist/schemas/3.1/unprocessed/paths-object.js +14 -2
- package/dist/schemas/3.1/unprocessed/paths-object.js.map +2 -2
- package/dist/schemas/extensions/index.d.ts +1 -0
- package/dist/schemas/extensions/index.d.ts.map +1 -1
- package/dist/schemas/extensions/index.js +3 -0
- package/dist/schemas/extensions/index.js.map +2 -2
- package/dist/schemas/extensions/x-post-response.d.ts +26 -0
- package/dist/schemas/extensions/x-post-response.d.ts.map +1 -0
- package/dist/schemas/extensions/x-post-response.js +10 -0
- package/dist/schemas/extensions/x-post-response.js.map +7 -0
- package/package.json +3 -3
- package/dist/schemas/3.1/compliance/callback-object.test.js +0 -97
- package/dist/schemas/3.1/compliance/callback-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/contact-object.test.js +0 -19
- package/dist/schemas/3.1/compliance/contact-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/example-object.test.js +0 -91
- package/dist/schemas/3.1/compliance/example-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/external-documentation-object.test.js +0 -17
- package/dist/schemas/3.1/compliance/external-documentation-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/header-object.test.js +0 -47
- package/dist/schemas/3.1/compliance/header-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/info-object.test.js +0 -41
- package/dist/schemas/3.1/compliance/info-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/license-object.test.js +0 -17
- package/dist/schemas/3.1/compliance/license-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/media-type-object.test.js +0 -69
- package/dist/schemas/3.1/compliance/media-type-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/openapi-object.test.js +0 -381
- package/dist/schemas/3.1/compliance/openapi-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/operation-object.test.js +0 -467
- package/dist/schemas/3.1/compliance/operation-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/parameter-object.test.js +0 -155
- package/dist/schemas/3.1/compliance/parameter-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/path-item-object.test.js +0 -103
- package/dist/schemas/3.1/compliance/path-item-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/reference-object.test.js +0 -282
- package/dist/schemas/3.1/compliance/reference-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/request-body-object.test.js +0 -97
- package/dist/schemas/3.1/compliance/request-body-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/response-object.test.js +0 -131
- package/dist/schemas/3.1/compliance/response-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/responses-object.test.js +0 -53
- package/dist/schemas/3.1/compliance/responses-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/runtime-expression.test.js +0 -165
- package/dist/schemas/3.1/compliance/runtime-expression.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/schema-object.test.js +0 -470
- package/dist/schemas/3.1/compliance/schema-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/security-requirement-object.test.js +0 -54
- package/dist/schemas/3.1/compliance/security-requirement-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/security-scheme-object.test.js +0 -123
- package/dist/schemas/3.1/compliance/security-scheme-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/server-object.test.js +0 -17
- package/dist/schemas/3.1/compliance/server-object.test.js.map +0 -7
- package/dist/schemas/3.1/compliance/tag-object.test.js +0 -17
- package/dist/schemas/3.1/compliance/tag-object.test.js.map +0 -7
- package/dist/schemas/3.1/processed/schema-object.test.js +0 -310
- package/dist/schemas/3.1/processed/schema-object.test.js.map +0 -7
- package/dist/schemas/extensions/x-additional-properties-name.test.js +0 -28
- package/dist/schemas/extensions/x-additional-properties-name.test.js.map +0 -7
- package/dist/schemas/extensions/x-code-samples.test.js +0 -82
- package/dist/schemas/extensions/x-code-samples.test.js.map +0 -7
- package/dist/schemas/extensions/x-display-name.test.js +0 -28
- package/dist/schemas/extensions/x-display-name.test.js.map +0 -7
- package/dist/schemas/extensions/x-enum-descriptions.test.js +0 -36
- package/dist/schemas/extensions/x-enum-descriptions.test.js.map +0 -7
- package/dist/schemas/extensions/x-internal.test.js +0 -20
- package/dist/schemas/extensions/x-internal.test.js.map +0 -7
- package/dist/schemas/extensions/x-scalar-icon.test.js +0 -14
- package/dist/schemas/extensions/x-scalar-icon.test.js.map +0 -7
- package/dist/schemas/extensions/x-scalar-ignore.test.js +0 -20
- package/dist/schemas/extensions/x-scalar-ignore.test.js.map +0 -7
- package/dist/schemas/extensions/x-scalar-redirect-uri.test.js +0 -23
- package/dist/schemas/extensions/x-scalar-redirect-uri.test.js.map +0 -7
- package/dist/schemas/extensions/x-scalar-sdk-installation.test.js +0 -25
- package/dist/schemas/extensions/x-scalar-sdk-installation.test.js.map +0 -7
- package/dist/schemas/extensions/x-scalar-security-query.test.js +0 -35
- package/dist/schemas/extensions/x-scalar-security-query.test.js.map +0 -7
- package/dist/schemas/extensions/x-scalar-stability.test.js +0 -33
- package/dist/schemas/extensions/x-scalar-stability.test.js.map +0 -7
- package/dist/schemas/extensions/x-tag-groups.test.js +0 -55
- package/dist/schemas/extensions/x-tag-groups.test.js.map +0 -7
- package/dist/schemas/extensions/x-use-pkce.test.js +0 -34
- package/dist/schemas/extensions/x-use-pkce.test.js.map +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/schemas/3.1/compliance/parameter-object.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { ParameterObjectSchema } from '../unprocessed/parameter-object'\n\ndescribe('parameter-object', () => {\n describe('ParameterObjectSchema', () => {\n // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#parameter-object-examples\n describe('Parameter Object Examples', () => {\n it('A header parameter with an array of 64-bit integer numbers', () => {\n const result = ParameterObjectSchema.parse({\n name: 'token',\n in: 'header',\n description: 'token to be passed as a header',\n required: true,\n schema: {\n type: 'array',\n items: {\n type: 'integer',\n format: 'int64',\n },\n },\n style: 'simple',\n })\n\n expect(result).toEqual({\n name: 'token',\n in: 'header',\n description: 'token to be passed as a header',\n required: true,\n schema: {\n type: 'array',\n items: {\n type: 'integer',\n format: 'int64',\n },\n },\n style: 'simple',\n })\n })\n\n it('A path parameter of a string value', () => {\n const result = ParameterObjectSchema.parse({\n name: 'username',\n in: 'path',\n description: 'username to fetch',\n required: true,\n schema: {\n type: 'string',\n },\n })\n\n expect(result).toEqual({\n name: 'username',\n in: 'path',\n description: 'username to fetch',\n required: true,\n schema: {\n type: 'string',\n },\n })\n })\n\n it('An optional query parameter of a string value, allowing multiple values by repeating the query parameter', () => {\n const result = ParameterObjectSchema.parse({\n name: 'id',\n in: 'query',\n description: 'ID of the object to fetch',\n required: false,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n style: 'form',\n explode: true,\n })\n\n expect(result).toEqual({\n name: 'id',\n in: 'query',\n description: 'ID of the object to fetch',\n required: false,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n style: 'form',\n explode: true,\n })\n })\n\n it('A free-form query parameter, allowing undefined parameters of a specific type', () => {\n const result = ParameterObjectSchema.parse({\n in: 'query',\n name: 'freeForm',\n schema: {\n type: 'object',\n additionalProperties: {\n type: 'integer',\n },\n },\n style: 'form',\n })\n\n expect(result).toEqual({\n in: 'query',\n name: 'freeForm',\n schema: {\n type: 'object',\n additionalProperties: {\n type: 'integer',\n },\n },\n style: 'form',\n })\n })\n\n it('A complex parameter using content to define serialization', () => {\n const result = ParameterObjectSchema.parse({\n in: 'query',\n name: 'coordinates',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n required: ['lat', 'long'],\n properties: {\n lat: {\n type: 'number',\n },\n long: {\n type: 'number',\n },\n },\n },\n },\n },\n })\n\n expect(result).toEqual({\n in: 'query',\n name: 'coordinates',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n required: ['lat', 'long'],\n properties: {\n lat: {\n type: 'number',\n },\n long: {\n type: 'number',\n },\n },\n },\n },\n },\n })\n })\n })\n })\n})\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,6BAA6B;AAEtC,SAAS,oBAAoB,MAAM;AACjC,WAAS,yBAAyB,MAAM;AAEtC,aAAS,6BAA6B,MAAM;AAC1C,SAAG,8DAA8D,MAAM;AACrE,cAAM,SAAS,sBAAsB,MAAM;AAAA,UACzC,MAAM;AAAA,UACN,IAAI;AAAA,UACJ,aAAa;AAAA,UACb,U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AAC;AAAA,MACH,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { PathItemObjectSchema } from "../unprocessed/path-item-object.js";
|
|
3
|
-
describe("path-item", () => {
|
|
4
|
-
describe("PathItemObjectSchema", () => {
|
|
5
|
-
it("Path Item Object Example", () => {
|
|
6
|
-
const result = PathItemObjectSchema.parse({
|
|
7
|
-
get: {
|
|
8
|
-
description: "Returns pets based on ID",
|
|
9
|
-
summary: "Find pets by ID",
|
|
10
|
-
operationId: "getPetsById",
|
|
11
|
-
responses: {
|
|
12
|
-
200: {
|
|
13
|
-
description: "pet response",
|
|
14
|
-
content: {
|
|
15
|
-
"*/*": {
|
|
16
|
-
schema: {
|
|
17
|
-
type: "array",
|
|
18
|
-
items: {
|
|
19
|
-
$ref: "#/components/schemas/Pet"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
default: {
|
|
26
|
-
description: "error payload",
|
|
27
|
-
content: {
|
|
28
|
-
"text/html": {
|
|
29
|
-
schema: {
|
|
30
|
-
$ref: "#/components/schemas/ErrorModel"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
parameters: [
|
|
38
|
-
{
|
|
39
|
-
name: "id",
|
|
40
|
-
in: "path",
|
|
41
|
-
description: "ID of pet to use",
|
|
42
|
-
required: true,
|
|
43
|
-
schema: {
|
|
44
|
-
type: "array",
|
|
45
|
-
items: {
|
|
46
|
-
type: "string"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
style: "simple"
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
});
|
|
53
|
-
expect(result).toEqual({
|
|
54
|
-
get: {
|
|
55
|
-
description: "Returns pets based on ID",
|
|
56
|
-
summary: "Find pets by ID",
|
|
57
|
-
operationId: "getPetsById",
|
|
58
|
-
responses: {
|
|
59
|
-
200: {
|
|
60
|
-
description: "pet response",
|
|
61
|
-
content: {
|
|
62
|
-
"*/*": {
|
|
63
|
-
schema: {
|
|
64
|
-
type: "array",
|
|
65
|
-
items: {
|
|
66
|
-
$ref: "#/components/schemas/Pet"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
default: {
|
|
73
|
-
description: "error payload",
|
|
74
|
-
content: {
|
|
75
|
-
"text/html": {
|
|
76
|
-
schema: {
|
|
77
|
-
$ref: "#/components/schemas/ErrorModel"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
parameters: [
|
|
85
|
-
{
|
|
86
|
-
name: "id",
|
|
87
|
-
in: "path",
|
|
88
|
-
description: "ID of pet to use",
|
|
89
|
-
required: true,
|
|
90
|
-
schema: {
|
|
91
|
-
type: "array",
|
|
92
|
-
items: {
|
|
93
|
-
type: "string"
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
style: "simple"
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
//# sourceMappingURL=path-item-object.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/schemas/3.1/compliance/path-item-object.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { PathItemObjectSchema } from '../unprocessed/path-item-object'\n\ndescribe('path-item', () => {\n describe('PathItemObjectSchema', () => {\n // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#path-item-object-example\n it('Path Item Object Example', () => {\n const result = PathItemObjectSchema.parse({\n get: {\n description: 'Returns pets based on ID',\n summary: 'Find pets by ID',\n operationId: 'getPetsById',\n responses: {\n 200: {\n description: 'pet response',\n content: {\n '*/*': {\n schema: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/Pet',\n },\n },\n },\n },\n },\n default: {\n description: 'error payload',\n content: {\n 'text/html': {\n schema: {\n $ref: '#/components/schemas/ErrorModel',\n },\n },\n },\n },\n },\n },\n parameters: [\n {\n name: 'id',\n in: 'path',\n description: 'ID of pet to use',\n required: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n style: 'simple',\n },\n ],\n })\n\n expect(result).toEqual({\n get: {\n description: 'Returns pets based on ID',\n summary: 'Find pets by ID',\n operationId: 'getPetsById',\n responses: {\n 200: {\n description: 'pet response',\n content: {\n '*/*': {\n schema: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/Pet',\n },\n },\n },\n },\n },\n default: {\n description: 'error payload',\n content: {\n 'text/html': {\n schema: {\n $ref: '#/components/schemas/ErrorModel',\n },\n },\n },\n },\n },\n },\n parameters: [\n {\n name: 'id',\n in: 'path',\n description: 'ID of pet to use',\n required: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n style: 'simple',\n },\n ],\n })\n })\n })\n})\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,4BAA4B;AAErC,SAAS,aAAa,MAAM;AAC1B,WAAS,wBAAwB,MAAM;AAErC,OAAG,4BAA4B,MAAM;AACnC,YAAM,SAAS,qBAAqB,MAAM;AAAA,QACxC,KAAK;AAAA,UACH,aAAa;AAAA,UACb,SAAS;AAAA,UACT,aAAa;AAAA,UACb,WAAW;AAAA,YACT,KAAK;AAAA,cACH,aAAa;AAAA,cACb,SAAS;AAAA,gBACP,OAAO;AAAA,kBACL,QAAQ;AAAA,oBACN,MAAM;AAAA,oBACN,OAAO;AAAA,sBACL,MAAM;AAAA,oBACR;A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AAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { ComponentsObjectSchema } from "../unprocessed/components-object.js";
|
|
3
|
-
import { EncodingObjectSchema } from "../unprocessed/encoding-object.js";
|
|
4
|
-
import { HeaderObjectSchema } from "../unprocessed/header-object.js";
|
|
5
|
-
import { MediaTypeObjectSchema } from "../unprocessed/media-type-object.js";
|
|
6
|
-
import { OperationObjectSchema } from "../unprocessed/operation-object.js";
|
|
7
|
-
import { ParameterObjectSchema } from "../unprocessed/parameter-object.js";
|
|
8
|
-
import { PathItemObjectSchema } from "../unprocessed/path-item-object.js";
|
|
9
|
-
import { ReferenceObjectSchema } from "../unprocessed/reference-object.js";
|
|
10
|
-
import { ResponseObjectSchema } from "../unprocessed/response-object.js";
|
|
11
|
-
import { ResponsesObjectSchema } from "../unprocessed/responses-object.js";
|
|
12
|
-
describe("reference-object", () => {
|
|
13
|
-
describe("ReferenceObjectSchema", () => {
|
|
14
|
-
it("Reference Object Example", () => {
|
|
15
|
-
const result = ReferenceObjectSchema.parse({
|
|
16
|
-
$ref: "#/components/schemas/Pet"
|
|
17
|
-
});
|
|
18
|
-
expect(result).toEqual({
|
|
19
|
-
$ref: "#/components/schemas/Pet"
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
describe("PathItemObjectSchema", () => {
|
|
24
|
-
it("path item object with $ref", () => {
|
|
25
|
-
const result = PathItemObjectSchema.parse({
|
|
26
|
-
$ref: "#/components/pathItems/foobar"
|
|
27
|
-
});
|
|
28
|
-
expect(result).toEqual({
|
|
29
|
-
$ref: "#/components/pathItems/foobar"
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
it("parameters with $ref", () => {
|
|
33
|
-
const result = PathItemObjectSchema.parse({
|
|
34
|
-
parameters: [
|
|
35
|
-
{
|
|
36
|
-
$ref: "#/components/parameters/foobar"
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
});
|
|
40
|
-
expect(result).toEqual({
|
|
41
|
-
parameters: [
|
|
42
|
-
{
|
|
43
|
-
$ref: "#/components/parameters/foobar"
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
describe("OperationObjectSchema", () => {
|
|
50
|
-
it("operation object with $ref", () => {
|
|
51
|
-
const result = OperationObjectSchema.parse({
|
|
52
|
-
parameters: [
|
|
53
|
-
{
|
|
54
|
-
$ref: "#/components/parameters/foobar"
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
|
-
requestBody: {
|
|
58
|
-
$ref: "#/components/requestBodies/foobar"
|
|
59
|
-
},
|
|
60
|
-
callbacks: {
|
|
61
|
-
foobar: {
|
|
62
|
-
$ref: "#/components/callbacks/foobar"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
expect(result).toEqual({
|
|
67
|
-
parameters: [{ $ref: "#/components/parameters/foobar" }],
|
|
68
|
-
requestBody: {
|
|
69
|
-
$ref: "#/components/requestBodies/foobar"
|
|
70
|
-
},
|
|
71
|
-
callbacks: {
|
|
72
|
-
foobar: {
|
|
73
|
-
$ref: "#/components/callbacks/foobar"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
describe("ParameterObjectSchema", () => {
|
|
80
|
-
it("parameter object with $ref", () => {
|
|
81
|
-
const result = ParameterObjectSchema.parse({
|
|
82
|
-
name: "foobar",
|
|
83
|
-
in: "query",
|
|
84
|
-
examples: {
|
|
85
|
-
foobar: {
|
|
86
|
-
$ref: "#/components/examples/foobar"
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
expect(result).toEqual({
|
|
91
|
-
name: "foobar",
|
|
92
|
-
in: "query",
|
|
93
|
-
examples: {
|
|
94
|
-
foobar: {
|
|
95
|
-
$ref: "#/components/examples/foobar"
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
describe("MediaTypeObjectSchema", () => {
|
|
102
|
-
it("media type object with $ref", () => {
|
|
103
|
-
const result = MediaTypeObjectSchema.parse({
|
|
104
|
-
examples: {
|
|
105
|
-
foobar: {
|
|
106
|
-
$ref: "#/components/examples/foobar"
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
expect(result).toEqual({
|
|
111
|
-
examples: {
|
|
112
|
-
foobar: { $ref: "#/components/examples/foobar" }
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
describe("EncodingObjectSchema", () => {
|
|
118
|
-
it("encoding object with $ref", () => {
|
|
119
|
-
const result = EncodingObjectSchema.parse({
|
|
120
|
-
contentType: "application/json",
|
|
121
|
-
headers: {
|
|
122
|
-
foobar: {
|
|
123
|
-
$ref: "#/components/headers/foobar"
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
expect(result).toEqual({
|
|
128
|
-
contentType: "application/json",
|
|
129
|
-
headers: {
|
|
130
|
-
foobar: {
|
|
131
|
-
$ref: "#/components/headers/foobar"
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
describe("ResponsesObjectSchema", () => {
|
|
138
|
-
it("responses object with $ref", () => {
|
|
139
|
-
const result = ResponsesObjectSchema.parse({
|
|
140
|
-
200: {
|
|
141
|
-
$ref: "#/components/responses/foobar"
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
expect(result).toEqual({
|
|
145
|
-
200: {
|
|
146
|
-
$ref: "#/components/responses/foobar"
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
describe("ResponseObjectSchema", () => {
|
|
152
|
-
it("response object with $ref", () => {
|
|
153
|
-
const result = ResponseObjectSchema.parse({
|
|
154
|
-
description: "foobar",
|
|
155
|
-
headers: {
|
|
156
|
-
foobar: {
|
|
157
|
-
$ref: "#/components/headers/foobar"
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
links: {
|
|
161
|
-
foobar: {
|
|
162
|
-
$ref: "#/components/links/foobar"
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
expect(result).toEqual({
|
|
167
|
-
description: "foobar",
|
|
168
|
-
headers: {
|
|
169
|
-
foobar: { $ref: "#/components/headers/foobar" }
|
|
170
|
-
},
|
|
171
|
-
links: {
|
|
172
|
-
foobar: { $ref: "#/components/links/foobar" }
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
describe("HeaderObjectSchema", () => {
|
|
178
|
-
it("header object with $ref", () => {
|
|
179
|
-
const result = HeaderObjectSchema.parse({
|
|
180
|
-
examples: {
|
|
181
|
-
foobar: {
|
|
182
|
-
$ref: "#/components/examples/foobar"
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
expect(result).toEqual({
|
|
187
|
-
examples: {
|
|
188
|
-
foobar: { $ref: "#/components/examples/foobar" }
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
});
|
|
193
|
-
describe("ComponentsObjectSchema", () => {
|
|
194
|
-
it("schemas with $ref", () => {
|
|
195
|
-
const result = ComponentsObjectSchema.parse({
|
|
196
|
-
responses: {
|
|
197
|
-
200: {
|
|
198
|
-
$ref: "#/components/responses/foobar"
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
parameters: {
|
|
202
|
-
id: {
|
|
203
|
-
$ref: "#/components/parameters/foobar"
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
examples: {
|
|
207
|
-
foobar: {
|
|
208
|
-
$ref: "#/components/examples/foobar"
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
requestBodies: {
|
|
212
|
-
foobar: {
|
|
213
|
-
$ref: "#/components/requestBodies/foobar"
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
headers: {
|
|
217
|
-
foobar: {
|
|
218
|
-
$ref: "#/components/headers/foobar"
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
securitySchemes: {
|
|
222
|
-
foobar: {
|
|
223
|
-
$ref: "#/components/securitySchemes/foobar"
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
links: {
|
|
227
|
-
foobar: {
|
|
228
|
-
$ref: "#/components/links/foobar"
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
callbacks: {
|
|
232
|
-
foobar: {
|
|
233
|
-
$ref: "#/components/callbacks/foobar"
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
expect(result).toEqual({
|
|
238
|
-
responses: {
|
|
239
|
-
200: {
|
|
240
|
-
$ref: "#/components/responses/foobar"
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
parameters: {
|
|
244
|
-
id: {
|
|
245
|
-
$ref: "#/components/parameters/foobar"
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
examples: {
|
|
249
|
-
foobar: {
|
|
250
|
-
$ref: "#/components/examples/foobar"
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
requestBodies: {
|
|
254
|
-
foobar: {
|
|
255
|
-
$ref: "#/components/requestBodies/foobar"
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
headers: {
|
|
259
|
-
foobar: {
|
|
260
|
-
$ref: "#/components/headers/foobar"
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
securitySchemes: {
|
|
264
|
-
foobar: {
|
|
265
|
-
$ref: "#/components/securitySchemes/foobar"
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
links: {
|
|
269
|
-
foobar: {
|
|
270
|
-
$ref: "#/components/links/foobar"
|
|
271
|
-
}
|
|
272
|
-
},
|
|
273
|
-
callbacks: {
|
|
274
|
-
foobar: {
|
|
275
|
-
$ref: "#/components/callbacks/foobar"
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
});
|
|
282
|
-
//# sourceMappingURL=reference-object.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/schemas/3.1/compliance/reference-object.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { ComponentsObjectSchema } from '../unprocessed/components-object'\nimport { EncodingObjectSchema } from '../unprocessed/encoding-object'\nimport { HeaderObjectSchema } from '../unprocessed/header-object'\nimport { MediaTypeObjectSchema } from '../unprocessed/media-type-object'\nimport { OperationObjectSchema } from '../unprocessed/operation-object'\nimport { ParameterObjectSchema } from '../unprocessed/parameter-object'\nimport { PathItemObjectSchema } from '../unprocessed/path-item-object'\nimport { ReferenceObjectSchema } from '../unprocessed/reference-object'\nimport { ResponseObjectSchema } from '../unprocessed/response-object'\nimport { ResponsesObjectSchema } from '../unprocessed/responses-object'\n\n// For these tests, I\u2019ve gone through the OpenAPI Specification and found places where the \u201CReference Object\u201D is used.\n\ndescribe('reference-object', () => {\n describe('ReferenceObjectSchema', () => {\n // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#reference-object-example\n it('Reference Object Example', () => {\n const result = ReferenceObjectSchema.parse({\n $ref: '#/components/schemas/Pet',\n })\n\n expect(result).toEqual({\n $ref: '#/components/schemas/Pet',\n })\n })\n })\n\n describe('PathItemObjectSchema', () => {\n it('path item object with $ref', () => {\n const result = PathItemObjectSchema.parse({\n $ref: '#/components/pathItems/foobar',\n })\n\n expect(result).toEqual({\n $ref: '#/components/pathItems/foobar',\n })\n })\n\n it('parameters with $ref', () => {\n const result = PathItemObjectSchema.parse({\n parameters: [\n {\n $ref: '#/components/parameters/foobar',\n },\n ],\n })\n\n expect(result).toEqual({\n parameters: [\n {\n $ref: '#/components/parameters/foobar',\n },\n ],\n })\n })\n })\n\n describe('OperationObjectSchema', () => {\n it('operation object with $ref', () => {\n const result = OperationObjectSchema.parse({\n parameters: [\n {\n $ref: '#/components/parameters/foobar',\n },\n ],\n requestBody: {\n $ref: '#/components/requestBodies/foobar',\n },\n callbacks: {\n foobar: {\n $ref: '#/components/callbacks/foobar',\n },\n },\n })\n\n expect(result).toEqual({\n parameters: [{ $ref: '#/components/parameters/foobar' }],\n requestBody: {\n $ref: '#/components/requestBodies/foobar',\n },\n callbacks: {\n foobar: {\n $ref: '#/components/callbacks/foobar',\n },\n },\n })\n })\n })\n\n describe('ParameterObjectSchema', () => {\n it('parameter object with $ref', () => {\n const result = ParameterObjectSchema.parse({\n name: 'foobar',\n in: 'query',\n examples: {\n foobar: {\n $ref: '#/components/examples/foobar',\n },\n },\n })\n\n expect(result).toEqual({\n name: 'foobar',\n in: 'query',\n examples: {\n foobar: {\n $ref: '#/components/examples/foobar',\n },\n },\n })\n })\n })\n\n describe('MediaTypeObjectSchema', () => {\n it('media type object with $ref', () => {\n const result = MediaTypeObjectSchema.parse({\n examples: {\n foobar: {\n $ref: '#/components/examples/foobar',\n },\n },\n })\n\n expect(result).toEqual({\n examples: {\n foobar: { $ref: '#/components/examples/foobar' },\n },\n })\n })\n })\n\n describe('EncodingObjectSchema', () => {\n it('encoding object with $ref', () => {\n const result = EncodingObjectSchema.parse({\n contentType: 'application/json',\n headers: {\n foobar: {\n $ref: '#/components/headers/foobar',\n },\n },\n })\n\n expect(result).toEqual({\n contentType: 'application/json',\n headers: {\n foobar: {\n $ref: '#/components/headers/foobar',\n },\n },\n })\n })\n })\n\n describe('ResponsesObjectSchema', () => {\n it('responses object with $ref', () => {\n const result = ResponsesObjectSchema.parse({\n 200: {\n $ref: '#/components/responses/foobar',\n },\n })\n\n expect(result).toEqual({\n 200: {\n $ref: '#/components/responses/foobar',\n },\n })\n })\n })\n\n describe('ResponseObjectSchema', () => {\n it('response object with $ref', () => {\n const result = ResponseObjectSchema.parse({\n description: 'foobar',\n headers: {\n foobar: {\n $ref: '#/components/headers/foobar',\n },\n },\n links: {\n foobar: {\n $ref: '#/components/links/foobar',\n },\n },\n })\n\n expect(result).toEqual({\n description: 'foobar',\n headers: {\n foobar: { $ref: '#/components/headers/foobar' },\n },\n links: {\n foobar: { $ref: '#/components/links/foobar' },\n },\n })\n })\n })\n\n describe('HeaderObjectSchema', () => {\n it('header object with $ref', () => {\n const result = HeaderObjectSchema.parse({\n examples: {\n foobar: {\n $ref: '#/components/examples/foobar',\n },\n },\n })\n\n expect(result).toEqual({\n examples: {\n foobar: { $ref: '#/components/examples/foobar' },\n },\n })\n })\n })\n\n describe('ComponentsObjectSchema', () => {\n it('schemas with $ref', () => {\n const result = ComponentsObjectSchema.parse({\n responses: {\n 200: {\n $ref: '#/components/responses/foobar',\n },\n },\n parameters: {\n id: {\n $ref: '#/components/parameters/foobar',\n },\n },\n examples: {\n foobar: {\n $ref: '#/components/examples/foobar',\n },\n },\n requestBodies: {\n foobar: {\n $ref: '#/components/requestBodies/foobar',\n },\n },\n headers: {\n foobar: {\n $ref: '#/components/headers/foobar',\n },\n },\n securitySchemes: {\n foobar: {\n $ref: '#/components/securitySchemes/foobar',\n },\n },\n links: {\n foobar: {\n $ref: '#/components/links/foobar',\n },\n },\n callbacks: {\n foobar: {\n $ref: '#/components/callbacks/foobar',\n },\n },\n })\n\n expect(result).toEqual({\n responses: {\n 200: {\n $ref: '#/components/responses/foobar',\n },\n },\n parameters: {\n id: {\n $ref: '#/components/parameters/foobar',\n },\n },\n examples: {\n foobar: {\n $ref: '#/components/examples/foobar',\n },\n },\n requestBodies: {\n foobar: {\n $ref: '#/components/requestBodies/foobar',\n },\n },\n headers: {\n foobar: {\n $ref: '#/components/headers/foobar',\n },\n },\n securitySchemes: {\n foobar: {\n $ref: '#/components/securitySchemes/foobar',\n },\n },\n links: {\n foobar: {\n $ref: '#/components/links/foobar',\n },\n },\n callbacks: {\n foobar: {\n $ref: '#/components/callbacks/foobar',\n },\n },\n })\n })\n })\n})\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,6BAA6B;AACtC,SAAS,6BAA6B;AACtC,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AAItC,SAAS,oBAAoB,MAAM;AACjC,WAAS,yBAAyB,MAAM;AAEtC,OAAG,4BAA4B,MAAM;AACnC,YAAM,SAAS,sBAAsB,MAAM;AAAA,QACzC,MAAM;AAAA,MACR,CAAC;AAED,aAAO,MAAM,EAAE,QAAQ;AAAA,QACrB,MAAM;AAAA,MACR,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AAED,WAAS,wBAAwB,MAAM;AACrC,OAAG,8BAA8B,MAAM;AACrC,YAAM,SAAS,qBAAqB,MAAM;AAAA,QACxC,MAAM;AAAA,MACR,CAAC;AAED,aAAO,MAAM,EAAE,QAAQ;AAAA,QACrB,MAAM;AAAA,MACR,CAAC;AAAA,IACH,CAAC;AAED,OAAG,wBAAwB,MAAM;AAC/B,YAAM,SAAS,qBAAqB,MAAM;AAAA,QACxC,YAAY;AAAA,UACV;AAAA,YACE,MAAM;AAAA,UACR;AAAA,QACF;AAAA,MACF,CAAC;AAED,aAAO,MAAM,EAAE,QAAQ;AAAA,QACrB,YAAY;AAAA,UACV;AAAA,YACE,MAAM;AAAA,UACR;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AAED,WAAS,yBAAyB,MAAM;AACtC,OAAG,8BAA8B,MAAM;AACrC,YAAM,SAAS,sBAAsB,MAAM;AAAA,QACzC,YAAY;AAAA,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AA,QACF;AAAA,QACA,iBAAiB;AAAA,UACf,QAAQ;AAAA,YACN,MAAM;AAAA,UACR;AAAA,QACF;AAAA,QACA,OAAO;AAAA,UACL,QAAQ;AAAA,YACN,MAAM;AAAA,UACR;AAAA,QACF;AAAA,QACA,WAAW;AAAA,UACT,QAAQ;AAAA,YACN,MAAM;AAAA,UACR;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { RequestBodyObjectSchema } from "../unprocessed/request-body-object.js";
|
|
3
|
-
describe("request-body-object", () => {
|
|
4
|
-
describe("ContactObjectSchema", () => {
|
|
5
|
-
describe("Request Body Examples", () => {
|
|
6
|
-
it("A request body with a referenced schema definition", () => {
|
|
7
|
-
const result = RequestBodyObjectSchema.parse({
|
|
8
|
-
description: "user to add to the system",
|
|
9
|
-
content: {
|
|
10
|
-
"application/json": {
|
|
11
|
-
schema: {
|
|
12
|
-
$ref: "#/components/schemas/User"
|
|
13
|
-
},
|
|
14
|
-
examples: {
|
|
15
|
-
user: {
|
|
16
|
-
summary: "User Example",
|
|
17
|
-
externalValue: "https://foo.bar/examples/user-example.json"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"application/xml": {
|
|
22
|
-
schema: {
|
|
23
|
-
$ref: "#/components/schemas/User"
|
|
24
|
-
},
|
|
25
|
-
examples: {
|
|
26
|
-
user: {
|
|
27
|
-
summary: "User example in XML",
|
|
28
|
-
externalValue: "https://foo.bar/examples/user-example.xml"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"text/plain": {
|
|
33
|
-
examples: {
|
|
34
|
-
user: {
|
|
35
|
-
summary: "User example in Plain text",
|
|
36
|
-
externalValue: "https://foo.bar/examples/user-example.txt"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"*/*": {
|
|
41
|
-
examples: {
|
|
42
|
-
user: {
|
|
43
|
-
summary: "User example in other format",
|
|
44
|
-
externalValue: "https://foo.bar/examples/user-example.whatever"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
expect(result).toEqual({
|
|
51
|
-
description: "user to add to the system",
|
|
52
|
-
content: {
|
|
53
|
-
"application/json": {
|
|
54
|
-
schema: {
|
|
55
|
-
$ref: "#/components/schemas/User"
|
|
56
|
-
},
|
|
57
|
-
examples: {
|
|
58
|
-
user: {
|
|
59
|
-
summary: "User Example",
|
|
60
|
-
externalValue: "https://foo.bar/examples/user-example.json"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"application/xml": {
|
|
65
|
-
schema: {
|
|
66
|
-
$ref: "#/components/schemas/User"
|
|
67
|
-
},
|
|
68
|
-
examples: {
|
|
69
|
-
user: {
|
|
70
|
-
summary: "User example in XML",
|
|
71
|
-
externalValue: "https://foo.bar/examples/user-example.xml"
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
"text/plain": {
|
|
76
|
-
examples: {
|
|
77
|
-
user: {
|
|
78
|
-
summary: "User example in Plain text",
|
|
79
|
-
externalValue: "https://foo.bar/examples/user-example.txt"
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
"*/*": {
|
|
84
|
-
examples: {
|
|
85
|
-
user: {
|
|
86
|
-
summary: "User example in other format",
|
|
87
|
-
externalValue: "https://foo.bar/examples/user-example.whatever"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
//# sourceMappingURL=request-body-object.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/schemas/3.1/compliance/request-body-object.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { RequestBodyObjectSchema } from '../unprocessed/request-body-object'\n\ndescribe('request-body-object', () => {\n describe('ContactObjectSchema', () => {\n // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#request-body-examples\n describe('Request Body Examples', () => {\n it('A request body with a referenced schema definition', () => {\n const result = RequestBodyObjectSchema.parse({\n description: 'user to add to the system',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/User',\n },\n examples: {\n user: {\n summary: 'User Example',\n externalValue: 'https://foo.bar/examples/user-example.json',\n },\n },\n },\n 'application/xml': {\n schema: {\n $ref: '#/components/schemas/User',\n },\n examples: {\n user: {\n summary: 'User example in XML',\n externalValue: 'https://foo.bar/examples/user-example.xml',\n },\n },\n },\n 'text/plain': {\n examples: {\n user: {\n summary: 'User example in Plain text',\n externalValue: 'https://foo.bar/examples/user-example.txt',\n },\n },\n },\n '*/*': {\n examples: {\n user: {\n summary: 'User example in other format',\n externalValue: 'https://foo.bar/examples/user-example.whatever',\n },\n },\n },\n },\n })\n\n expect(result).toEqual({\n description: 'user to add to the system',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/User',\n },\n examples: {\n user: {\n summary: 'User Example',\n externalValue: 'https://foo.bar/examples/user-example.json',\n },\n },\n },\n 'application/xml': {\n schema: {\n $ref: '#/components/schemas/User',\n },\n examples: {\n user: {\n summary: 'User example in XML',\n externalValue: 'https://foo.bar/examples/user-example.xml',\n },\n },\n },\n 'text/plain': {\n examples: {\n user: {\n summary: 'User example in Plain text',\n externalValue: 'https://foo.bar/examples/user-example.txt',\n },\n },\n },\n '*/*': {\n examples: {\n user: {\n summary: 'User example in other format',\n externalValue: 'https://foo.bar/examples/user-example.whatever',\n },\n },\n },\n },\n })\n })\n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