@scalar/oas-utils 0.3.1 → 0.4.0
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 +22 -0
- package/dist/entities/spec/collection.d.ts +6 -12
- package/dist/entities/spec/collection.d.ts.map +1 -1
- package/dist/entities/spec/collection.js +1 -1
- package/dist/entities/spec/collection.js.map +2 -2
- package/dist/entities/spec/operation.d.ts +3 -0
- package/dist/entities/spec/operation.d.ts.map +1 -1
- package/dist/entities/spec/request-examples.js +1 -1
- package/dist/entities/spec/request-examples.js.map +2 -2
- package/dist/entities/spec/requests.d.ts +8 -0
- package/dist/entities/spec/requests.d.ts.map +1 -1
- package/dist/entities/spec/requests.js +2 -0
- package/dist/entities/spec/requests.js.map +2 -2
- package/dist/helpers/http-methods.js +9 -9
- package/dist/helpers/http-methods.js.map +1 -1
- package/dist/helpers/pretty-print-json.d.ts.map +1 -1
- package/dist/helpers/pretty-print-json.js.map +2 -2
- package/dist/transforms/import-spec.d.ts +8 -3
- package/dist/transforms/import-spec.d.ts.map +1 -1
- package/dist/transforms/import-spec.js +30 -9
- package/dist/transforms/import-spec.js.map +2 -2
- package/package.json +4 -4
- package/dist/entities/spec/operation.test.js +0 -43
- package/dist/entities/spec/operation.test.js.map +0 -7
- package/dist/entities/spec/parameters.test.js +0 -80
- package/dist/entities/spec/parameters.test.js.map +0 -7
- package/dist/entities/spec/request-example.test.js +0 -636
- package/dist/entities/spec/request-example.test.js.map +0 -7
- package/dist/entities/spec/server.test.js +0 -120
- package/dist/entities/spec/server.test.js.map +0 -7
- package/dist/entities/spec/spec-objects.test.js +0 -205
- package/dist/entities/spec/spec-objects.test.js.map +0 -7
- package/dist/entities/spec/x-scalar-environments.test.js +0 -11
- package/dist/entities/spec/x-scalar-environments.test.js.map +0 -7
- package/dist/entities/spec/x-scalar-secrets.test.js +0 -11
- package/dist/entities/spec/x-scalar-secrets.test.js.map +0 -7
- package/dist/helpers/ensure-protocol.test.js +0 -70
- package/dist/helpers/ensure-protocol.test.js.map +0 -7
- package/dist/helpers/fetch-document.test.js +0 -63
- package/dist/helpers/fetch-document.test.js.map +0 -7
- package/dist/helpers/find-variables.test.js +0 -20
- package/dist/helpers/find-variables.test.js.map +0 -7
- package/dist/helpers/is-defined.test.js +0 -37
- package/dist/helpers/is-defined.test.js.map +0 -7
- package/dist/helpers/is-local-url.test.js +0 -40
- package/dist/helpers/is-local-url.test.js.map +0 -7
- package/dist/helpers/is-valid-url.test.js +0 -17
- package/dist/helpers/is-valid-url.test.js.map +0 -7
- package/dist/helpers/json2xml.test.js +0 -19
- package/dist/helpers/json2xml.test.js.map +0 -7
- package/dist/helpers/make-url-absolute.test.js +0 -61
- package/dist/helpers/make-url-absolute.test.js.map +0 -7
- package/dist/helpers/merge-urls.test.js +0 -339
- package/dist/helpers/merge-urls.test.js.map +0 -7
- package/dist/helpers/normalize-mime-type-object.test.js +0 -53
- package/dist/helpers/normalize-mime-type-object.test.js.map +0 -7
- package/dist/helpers/normalize-mime-type.test.js +0 -33
- package/dist/helpers/normalize-mime-type.test.js.map +0 -7
- package/dist/helpers/omit-undefined-values.test.js +0 -89
- package/dist/helpers/omit-undefined-values.test.js.map +0 -7
- package/dist/helpers/parse.test.js +0 -45
- package/dist/helpers/parse.test.js.map +0 -7
- package/dist/helpers/pretty-print-json.test.js +0 -28
- package/dist/helpers/pretty-print-json.test.js.map +0 -7
- package/dist/helpers/redirect-to-proxy.test.js +0 -54
- package/dist/helpers/redirect-to-proxy.test.js.map +0 -7
- package/dist/helpers/regex-helpers.test.js +0 -154
- package/dist/helpers/regex-helpers.test.js.map +0 -7
- package/dist/helpers/replace-variables.test.js +0 -30
- package/dist/helpers/replace-variables.test.js.map +0 -7
- package/dist/helpers/security/get-schemes.test.js +0 -71
- package/dist/helpers/security/get-schemes.test.js.map +0 -7
- package/dist/helpers/security/has-token.test.js +0 -157
- package/dist/helpers/security/has-token.test.js.map +0 -7
- package/dist/migrations/semver.test.js +0 -21
- package/dist/migrations/semver.test.js.map +0 -7
- package/dist/migrations/v-2.4.0/migration.test.js +0 -90
- package/dist/migrations/v-2.4.0/migration.test.js.map +0 -7
- package/dist/migrations/v-2.5.0/migration.test.js +0 -108
- package/dist/migrations/v-2.5.0/migration.test.js.map +0 -7
- package/dist/spec-getters/get-example-from-schema.test.js +0 -1092
- package/dist/spec-getters/get-example-from-schema.test.js.map +0 -7
- package/dist/spec-getters/get-parameters-from-operation.test.js +0 -178
- package/dist/spec-getters/get-parameters-from-operation.test.js.map +0 -7
- package/dist/spec-getters/get-request-body-from-operation.test.js +0 -289
- package/dist/spec-getters/get-request-body-from-operation.test.js.map +0 -7
- package/dist/transforms/import-spec.test.js +0 -1124
- package/dist/transforms/import-spec.test.js.map +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/spec-getters/get-example-from-schema.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { getExampleFromSchema } from './get-example-from-schema'\n\ndescribe('getExampleFromSchema', () => {\n it('sets example values', () => {\n expect(\n getExampleFromSchema({\n example: 10,\n }),\n ).toMatchObject(10)\n })\n\n it('uses first example, if multiple are configured', () => {\n expect(\n getExampleFromSchema({\n examples: [10],\n }),\n ).toMatchObject(10)\n })\n\n it('takes the first enum as example', () => {\n expect(\n getExampleFromSchema({\n enum: ['available', 'pending', 'sold'],\n }),\n ).toBe('available')\n })\n\n it('uses empty quotes as a fallback for strings', () => {\n expect(\n getExampleFromSchema({\n type: 'string',\n }),\n ).toBe('')\n })\n\n it('only includes required attributes and attributes with example values', () => {\n expect(\n getExampleFromSchema(\n {\n type: 'object',\n required: ['first_name'],\n properties: {\n first_name: {\n type: 'string',\n },\n last_name: {\n type: 'string',\n required: true,\n },\n position: {\n type: 'string',\n examples: ['Developer'],\n },\n description: {\n type: 'string',\n example: 'A developer',\n },\n age: {\n type: 'number',\n },\n },\n },\n {\n omitEmptyAndOptionalProperties: true,\n },\n ),\n ).toStrictEqual({\n first_name: '',\n last_name: '',\n position: 'Developer',\n description: 'A developer',\n })\n })\n\n it('includes every available attributes', () => {\n expect(\n getExampleFromSchema(\n {\n type: 'object',\n required: ['first_name'],\n properties: {\n first_name: {\n type: 'string',\n },\n last_name: {\n type: 'string',\n required: true,\n },\n position: {\n type: 'string',\n examples: ['Developer'],\n },\n description: {\n type: 'string',\n example: 'A developer',\n },\n age: {\n type: 'number',\n },\n },\n },\n {\n omitEmptyAndOptionalProperties: false,\n },\n ),\n ).toStrictEqual({\n first_name: '',\n last_name: '',\n position: 'Developer',\n description: 'A developer',\n age: 1,\n })\n })\n\n it('uses example value for first type in non-null union types', () => {\n expect(\n getExampleFromSchema({\n type: ['string', 'number'],\n }),\n ).toBe('')\n })\n\n it('uses null for nullable union types', () => {\n expect(\n getExampleFromSchema({\n type: ['string', 'null'],\n }),\n ).toBeNull()\n })\n\n it('sets example values', () => {\n expect(\n getExampleFromSchema({\n example: 10,\n }),\n ).toMatchObject(10)\n })\n\n it('goes through properties recursively with objects', () => {\n expect(\n getExampleFromSchema({\n type: 'object',\n properties: {\n category: {\n type: 'object',\n properties: {\n id: {\n example: 1,\n },\n name: {\n example: 'Dogs',\n },\n attributes: {\n type: 'object',\n properties: {\n size: {\n enum: ['small', 'medium', 'large'],\n },\n },\n },\n },\n },\n },\n }),\n ).toMatchObject({\n category: {\n id: 1,\n name: 'Dogs',\n attributes: {\n size: 'small',\n },\n },\n })\n })\n\n it('goes through properties recursively with arrays', () => {\n expect(\n getExampleFromSchema({\n type: 'object',\n properties: {\n tags: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n example: 1,\n },\n },\n },\n },\n },\n }),\n ).toMatchObject({\n tags: [\n {\n id: 1,\n },\n ],\n })\n })\n\n it('uses empty [] as a fallback for arrays', () => {\n expect(\n getExampleFromSchema({\n type: 'object',\n properties: {\n title: {\n type: 'array',\n },\n },\n }),\n ).toMatchObject({\n title: [],\n })\n })\n\n it('uses given fallback for strings', () => {\n expect(\n getExampleFromSchema(\n {\n type: 'string',\n },\n {\n emptyString: '\u2026',\n },\n ),\n ).toBe('\u2026')\n })\n\n it('returns emails as an example value', () => {\n const result = getExampleFromSchema(\n {\n type: 'string',\n format: 'email',\n },\n {\n emptyString: '\u2026',\n },\n )\n\n function isEmail(text: string) {\n return !!text.match(/^.+@.+\\..+$/)\n }\n\n expect(isEmail(result)).toBe(true)\n })\n\n it('uses variables as an example value', () => {\n expect(\n getExampleFromSchema(\n {\n 'type': 'string',\n 'x-variable': 'id',\n },\n {\n variables: {\n id: 'foobar',\n },\n },\n ),\n ).toBe('foobar')\n })\n\n it('uses true as a fallback for booleans', () => {\n expect(\n getExampleFromSchema({\n type: 'boolean',\n }),\n ).toMatchObject(true)\n })\n\n it('uses 1 as a fallback for integers', () => {\n expect(\n getExampleFromSchema({\n type: 'integer',\n }),\n ).toMatchObject(1)\n })\n\n it('returns an array if the schema type is array', () => {\n expect(\n getExampleFromSchema({\n type: 'array',\n }),\n ).toMatchObject([])\n })\n\n it('uses array example values', () => {\n expect(\n getExampleFromSchema({\n type: 'array',\n example: ['foobar'],\n items: {\n type: 'string',\n },\n }),\n ).toMatchObject(['foobar'])\n })\n\n it('uses specified object as array default', () => {\n expect(\n getExampleFromSchema({\n type: 'array',\n items: {\n type: 'object',\n properties: {\n foo: {\n type: 'number',\n },\n bar: {\n type: 'string',\n },\n },\n },\n }),\n ).toMatchObject([\n {\n foo: 1,\n bar: '',\n },\n ])\n })\n\n it('uses the first example in object anyOf', () => {\n expect(\n getExampleFromSchema({\n type: 'object',\n anyOf: [\n {\n type: 'object',\n properties: {\n foo: { type: 'number' },\n },\n },\n {\n type: 'object',\n properties: {\n bar: { type: 'string' },\n },\n },\n ],\n }),\n ).toMatchObject({ foo: 1 })\n })\n\n it('uses the first example in object oneOf', () => {\n expect(\n getExampleFromSchema({\n type: 'object',\n oneOf: [\n {\n type: 'object',\n properties: {\n foo: { type: 'number' },\n },\n },\n {\n type: 'object',\n properties: {\n bar: { type: 'string' },\n },\n },\n ],\n }),\n ).toMatchObject({ foo: 1 })\n })\n\n it('uses the first example in object anyOf when type is not defined', () => {\n expect(\n getExampleFromSchema({\n anyOf: [\n {\n type: 'object',\n properties: {\n foo: { type: 'number' },\n },\n },\n {\n type: 'object',\n properties: {\n bar: { type: 'string' },\n },\n },\n ],\n }),\n ).toMatchObject({ foo: 1 })\n })\n\n it('uses the first example in object oneOf when type is not defined', () => {\n expect(\n getExampleFromSchema({\n oneOf: [\n {\n type: 'object',\n properties: {\n foo: { type: 'number' },\n },\n },\n {\n type: 'object',\n properties: {\n bar: { type: 'string' },\n },\n },\n ],\n }),\n ).toMatchObject({ foo: 1 })\n })\n\n it('uses all examples in object allOf', () => {\n expect(\n getExampleFromSchema({\n allOf: [\n {\n type: 'object',\n properties: {\n foo: { type: 'number' },\n },\n },\n {\n type: 'object',\n properties: {\n bar: { type: 'string' },\n },\n },\n ],\n }),\n ).toMatchObject({ foo: 1, bar: '' })\n })\n\n it('merges allOf items in arrays', () => {\n expect(\n getExampleFromSchema({\n type: 'array',\n items: {\n allOf: [\n {\n type: 'object',\n properties: {\n foobar: { type: 'string' },\n foo: { type: 'number' },\n },\n },\n {\n type: 'object',\n properties: {\n bar: { type: 'string' },\n },\n },\n ],\n },\n }),\n ).toMatchObject([{ foobar: '', foo: 1, bar: '' }])\n })\n\n it('handles array items with allOf containing objects', () => {\n expect(\n getExampleFromSchema({\n type: 'array',\n items: {\n allOf: [\n {\n type: 'object',\n properties: {\n id: { type: 'number', example: 1 },\n },\n },\n {\n type: 'object',\n properties: {\n name: { type: 'string', example: 'test' },\n },\n },\n ],\n },\n }),\n ).toMatchObject([\n {\n id: 1,\n name: 'test',\n },\n ])\n })\n\n it('uses the first example in array anyOf', () => {\n expect(\n getExampleFromSchema({\n type: 'array',\n items: {\n anyOf: [\n {\n type: 'string',\n example: 'foobar',\n },\n {\n type: 'string',\n example: 'barfoo',\n },\n ],\n },\n }),\n ).toMatchObject(['foobar'])\n })\n\n it('uses one example in array oneOf', () => {\n expect(\n getExampleFromSchema({\n type: 'array',\n items: {\n oneOf: [\n {\n type: 'string',\n example: 'foobar',\n },\n {\n type: 'string',\n example: 'barfoo',\n },\n ],\n },\n }),\n ).toMatchObject(['foobar'])\n })\n\n it('uses all examples in array allOf', () => {\n expect(\n getExampleFromSchema({\n type: 'array',\n items: {\n allOf: [\n {\n type: 'string',\n example: 'foobar',\n },\n {\n type: 'string',\n example: 'barfoo',\n },\n ],\n },\n }),\n ).toMatchObject(['foobar', 'barfoo'])\n })\n\n it('uses the default value', () => {\n const schema = {\n type: 'string',\n default: 'BAD_REQUEST_EXCEPTION',\n }\n\n expect(getExampleFromSchema(schema)).toBe('BAD_REQUEST_EXCEPTION')\n })\n\n it('uses 1 as the default for a number', () => {\n expect(\n getExampleFromSchema({\n type: 'number',\n }),\n ).toMatchObject(1)\n })\n\n it('uses min as the default for a number', () => {\n expect(\n getExampleFromSchema({\n type: 'number',\n min: 200,\n }),\n ).toMatchObject(200)\n })\n\n it('returns plaintext', () => {\n expect(\n getExampleFromSchema({\n type: 'string',\n example: 'foobar',\n }),\n ).toEqual('foobar')\n })\n\n it('converts a whole schema to an example response', () => {\n const schema = {\n required: ['name', 'photoUrls'],\n type: 'object',\n properties: {\n id: {\n type: 'integer',\n format: 'int64',\n example: 10,\n },\n name: {\n type: 'string',\n example: 'doggie',\n },\n category: {\n type: 'object',\n properties: {\n id: {\n type: 'integer',\n format: 'int64',\n example: 1,\n },\n name: {\n type: 'string',\n example: 'Dogs',\n },\n },\n xml: {\n name: 'category',\n },\n },\n photoUrls: {\n type: 'array',\n xml: {\n wrapped: true,\n },\n items: {\n type: 'string',\n xml: {\n name: 'photoUrl',\n },\n },\n },\n tags: {\n type: 'array',\n xml: {\n wrapped: true,\n },\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'integer',\n format: 'int64',\n },\n name: {\n type: 'string',\n },\n },\n xml: {\n name: 'tag',\n },\n },\n },\n status: {\n type: 'string',\n description: 'pet status in the store',\n enum: ['available', 'pending', 'sold'],\n },\n },\n xml: {\n name: 'pet',\n },\n }\n\n expect(getExampleFromSchema(schema)).toMatchObject({\n id: 10,\n name: 'doggie',\n category: {\n id: 1,\n name: 'Dogs',\n },\n photoUrls: [''],\n tags: [\n {\n id: 1,\n name: '',\n },\n ],\n status: 'available',\n })\n })\n\n it('outputs XML', () => {\n expect(\n getExampleFromSchema(\n {\n type: 'object',\n properties: {\n id: {\n example: 1,\n xml: {\n name: 'foo',\n },\n },\n },\n },\n { xml: true },\n ),\n ).toMatchObject({\n foo: 1,\n })\n })\n\n it('add XML wrappers where needed', () => {\n expect(\n getExampleFromSchema(\n {\n type: 'object',\n properties: {\n photoUrls: {\n type: 'array',\n xml: {\n wrapped: true,\n },\n items: {\n type: 'string',\n example: 'https://example.com',\n xml: {\n name: 'photoUrl',\n },\n },\n },\n },\n },\n { xml: true },\n ),\n ).toMatchObject({\n photoUrls: [{ photoUrl: 'https://example.com' }],\n })\n })\n\n it('doesn\u2019t wrap items when not needed', () => {\n expect(\n getExampleFromSchema(\n {\n type: 'object',\n properties: {\n photoUrls: {\n type: 'array',\n items: {\n type: 'string',\n example: 'https://example.com',\n xml: {\n name: 'photoUrl',\n },\n },\n },\n },\n },\n { xml: true },\n ),\n ).toMatchObject({\n photoUrls: ['https://example.com'],\n })\n })\n\n it('use the first item of oneOf', () => {\n expect(\n getExampleFromSchema({\n oneOf: [\n {\n maxLength: 255,\n type: 'string',\n },\n {\n type: 'null',\n },\n ],\n }),\n ).toBe('')\n })\n\n it('works with allOf', () => {\n expect(\n getExampleFromSchema({\n allOf: [\n {\n type: 'string',\n },\n ],\n }),\n ).toBe('')\n })\n\n it('uses all schemas in allOf', () => {\n expect(\n getExampleFromSchema({\n allOf: [\n {\n type: 'object',\n properties: {\n id: {\n example: 10,\n },\n },\n },\n {\n type: 'object',\n properties: {\n title: {\n example: 'Foobar',\n },\n },\n },\n ],\n }),\n ).toMatchObject({\n id: 10,\n title: 'Foobar',\n })\n })\n\n it('returns null for unknown types', () => {\n expect(\n getExampleFromSchema({\n type: 'fantasy',\n }),\n ).toBe(null)\n })\n\n it('returns readOnly attributes by default', () => {\n expect(\n getExampleFromSchema({\n example: 'foobar',\n readOnly: true,\n }),\n ).toBe('foobar')\n })\n\n it('returns readOnly attributes in read mode', () => {\n expect(\n getExampleFromSchema(\n {\n example: 'foobar',\n readOnly: true,\n },\n {\n mode: 'read',\n },\n ),\n ).toBe('foobar')\n })\n\n it('doesn\u2019t return readOnly attributes in write mode', () => {\n expect(\n getExampleFromSchema(\n {\n example: 'foobar',\n readOnly: true,\n },\n {\n mode: 'write',\n },\n ),\n ).toBe(undefined)\n })\n\n it('returns writeOnly attributes by default', () => {\n expect(\n getExampleFromSchema({\n example: 'foobar',\n writeOnly: true,\n }),\n ).toBe('foobar')\n })\n\n it('returns writeOnly attributes in write mode', () => {\n expect(\n getExampleFromSchema(\n {\n example: 'foobar',\n writeOnly: true,\n },\n {\n mode: 'write',\n },\n ),\n ).toBe('foobar')\n })\n\n it('doesn\u2019t return writeOnly attributes in read mode', () => {\n expect(\n getExampleFromSchema(\n {\n example: 'foobar',\n writeOnly: true,\n },\n {\n mode: 'read',\n },\n ),\n ).toBe(undefined)\n })\n\n it('allows any additonalProperty', () => {\n expect(\n getExampleFromSchema({\n type: 'object',\n additionalProperties: {},\n }),\n ).toMatchObject({\n ANY_ADDITIONAL_PROPERTY: 'anything',\n })\n\n expect(\n getExampleFromSchema({\n type: 'object',\n additionalProperties: true,\n }),\n ).toMatchObject({\n ANY_ADDITIONAL_PROPERTY: 'anything',\n })\n })\n\n it('adds an additionalProperty with specific types', () => {\n expect(\n getExampleFromSchema({\n type: 'object',\n additionalProperties: {\n type: 'integer',\n },\n }),\n ).toMatchObject({\n ANY_ADDITIONAL_PROPERTY: 1,\n })\n\n expect(\n getExampleFromSchema({\n type: 'object',\n additionalProperties: {\n type: 'boolean',\n },\n }),\n ).toMatchObject({\n ANY_ADDITIONAL_PROPERTY: true,\n })\n\n expect(\n getExampleFromSchema({\n type: 'object',\n additionalProperties: {\n type: 'boolean',\n default: false,\n },\n }),\n ).toMatchObject({\n ANY_ADDITIONAL_PROPERTY: false,\n })\n\n expect(\n getExampleFromSchema({\n type: 'object',\n additionalProperties: {\n type: 'string',\n },\n }),\n ).toMatchObject({\n ANY_ADDITIONAL_PROPERTY: '',\n })\n\n expect(\n getExampleFromSchema({\n type: 'object',\n additionalProperties: {\n type: 'object',\n properties: {\n foo: {\n type: 'string',\n },\n },\n },\n }),\n ).toMatchObject({\n ANY_ADDITIONAL_PROPERTY: {\n foo: '',\n },\n })\n })\n\n it('works with anyOf', () => {\n expect(\n getExampleFromSchema({\n title: 'Foo',\n type: 'object',\n anyOf: [\n {\n type: 'object',\n required: ['a'],\n properties: {\n a: {\n type: 'integer',\n format: 'int32',\n },\n },\n },\n {\n type: 'object',\n required: ['b'],\n properties: {\n b: {\n type: 'string',\n },\n },\n },\n ],\n required: ['c'],\n properties: {\n c: {\n type: 'boolean',\n },\n },\n }),\n ).toStrictEqual({\n a: 1,\n c: true,\n })\n })\n\n it('handles patternProperties', () => {\n expect(\n getExampleFromSchema({\n type: 'object',\n patternProperties: {\n '^(.*)$': {\n type: 'object',\n properties: {\n dataId: {\n type: 'string',\n },\n link: {\n anyOf: [\n {\n format: 'uri',\n type: 'string',\n example: 'https://example.com',\n },\n {\n type: 'null',\n },\n ],\n },\n },\n required: ['dataId', 'link'],\n },\n },\n }),\n ).toStrictEqual({\n '^(.*)$': {\n dataId: '',\n link: 'https://example.com',\n },\n })\n })\n\n describe('circular references', () => {\n it('deals with circular references', () => {\n const schema = {\n type: 'object',\n properties: {\n foobar: {},\n },\n }\n\n // Create a circular reference\n schema.properties.foobar = schema\n\n // 10 levels deep, that\u2019s enough. It should return null then.\n expect(getExampleFromSchema(schema)).toStrictEqual({\n foobar: {\n foobar: {\n foobar: {\n foobar: {\n foobar: {\n foobar: '[Circular Reference]',\n },\n },\n },\n },\n },\n })\n })\n\n it('deals with circular references that expand horizontally', () => {\n const schema = {\n type: 'object',\n properties: {\n a: {},\n b: {},\n c: {},\n d: {},\n e: {},\n f: {},\n g: {},\n h: {},\n i: {},\n j: {},\n k: {},\n l: {},\n m: {},\n n: {},\n o: {},\n p: {},\n q: {},\n r: {},\n s: {},\n t: {},\n u: {},\n v: {},\n w: {},\n x: {},\n y: {},\n z: {},\n },\n }\n\n // Create a circular reference for each property\n schema.properties.a = schema\n schema.properties.b = schema\n schema.properties.c = schema\n schema.properties.d = schema\n schema.properties.e = schema\n schema.properties.f = schema\n schema.properties.g = schema\n schema.properties.h = schema\n schema.properties.i = schema\n schema.properties.j = schema\n schema.properties.k = schema\n schema.properties.l = schema\n schema.properties.m = schema\n schema.properties.n = schema\n schema.properties.o = schema\n schema.properties.p = schema\n schema.properties.q = schema\n schema.properties.r = schema\n schema.properties.s = schema\n schema.properties.t = schema\n schema.properties.u = schema\n schema.properties.v = schema\n schema.properties.w = schema\n schema.properties.x = schema\n schema.properties.y = schema\n schema.properties.z = schema\n\n const example = getExampleFromSchema(schema)\n expect(example).toBeInstanceOf(Object)\n expect(Object.keys(example).length).toBe(26)\n })\n })\n\n it('omits deprecated properties', () => {\n expect(\n getExampleFromSchema({\n type: 'object',\n properties: {\n name: {\n type: 'string',\n example: 'test',\n },\n oldField: {\n type: 'string',\n example: 'should not appear',\n deprecated: true,\n },\n },\n }),\n ).toStrictEqual({\n name: 'test',\n })\n })\n})\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,4BAA4B;AAErC,SAAS,wBAAwB,MAAM;AACrC,KAAG,uBAAuB,MAAM;AAC9B;AAAA,MACE,qBAAqB;AAAA,QACnB,SAAS;AAAA,MACX,CAAC;AAAA,IACH,EAAE,cAAc,EAAE;AAAA,EACpB,CAAC;AAED,KAAG,kDAAkD,MAAM;AACzD;AAAA,MACE,qBAAqB;A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AAK,EAAE;AAAA,IAC7C,CAAC;AAAA,EACH,CAAC;AAED,KAAG,+BAA+B,MAAM;AACtC;AAAA,MACE,qBAAqB;AAAA,QACnB,MAAM;AAAA,QACN,YAAY;AAAA,UACV,MAAM;AAAA,YACJ,MAAM;AAAA,YACN,SAAS;AAAA,UACX;AAAA,UACA,UAAU;AAAA,YACR,MAAM;AAAA,YACN,SAAS;AAAA,YACT,YAAY;AAAA,UACd;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,EAAE,cAAc;AAAA,MACd,MAAM;AAAA,IACR,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { getParametersFromOperation } from "./get-parameters-from-operation.js";
|
|
3
|
-
describe("getParametersFromOperation", () => {
|
|
4
|
-
it("operation query parameters", () => {
|
|
5
|
-
const request = getParametersFromOperation(
|
|
6
|
-
{
|
|
7
|
-
path: "/foobar",
|
|
8
|
-
information: {
|
|
9
|
-
parameters: [
|
|
10
|
-
{
|
|
11
|
-
in: "query",
|
|
12
|
-
name: "api_key",
|
|
13
|
-
required: true
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"query"
|
|
19
|
-
);
|
|
20
|
-
expect(request).toMatchObject([
|
|
21
|
-
{
|
|
22
|
-
name: "api_key",
|
|
23
|
-
value: ""
|
|
24
|
-
}
|
|
25
|
-
]);
|
|
26
|
-
});
|
|
27
|
-
it("path query parameters", () => {
|
|
28
|
-
const request = getParametersFromOperation(
|
|
29
|
-
{
|
|
30
|
-
path: "/foobar",
|
|
31
|
-
pathParameters: [
|
|
32
|
-
{
|
|
33
|
-
in: "query",
|
|
34
|
-
name: "api_key",
|
|
35
|
-
required: true
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
"query"
|
|
40
|
-
);
|
|
41
|
-
expect(request).toMatchObject([
|
|
42
|
-
{
|
|
43
|
-
name: "api_key",
|
|
44
|
-
value: ""
|
|
45
|
-
}
|
|
46
|
-
]);
|
|
47
|
-
});
|
|
48
|
-
it("path + operation query parameters", () => {
|
|
49
|
-
const request = getParametersFromOperation(
|
|
50
|
-
{
|
|
51
|
-
path: "/foobar",
|
|
52
|
-
operationId: "foobar",
|
|
53
|
-
name: "foobar",
|
|
54
|
-
description: "",
|
|
55
|
-
pathParameters: [
|
|
56
|
-
{
|
|
57
|
-
in: "query",
|
|
58
|
-
name: "foo",
|
|
59
|
-
required: true
|
|
60
|
-
}
|
|
61
|
-
],
|
|
62
|
-
information: {
|
|
63
|
-
parameters: [
|
|
64
|
-
{
|
|
65
|
-
in: "query",
|
|
66
|
-
name: "bar",
|
|
67
|
-
required: true
|
|
68
|
-
}
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
"query"
|
|
73
|
-
);
|
|
74
|
-
expect(request).toMatchObject([
|
|
75
|
-
{
|
|
76
|
-
name: "foo",
|
|
77
|
-
value: ""
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: "bar",
|
|
81
|
-
value: ""
|
|
82
|
-
}
|
|
83
|
-
]);
|
|
84
|
-
});
|
|
85
|
-
it("parameters with `required` and `description`", () => {
|
|
86
|
-
const request = getParametersFromOperation(
|
|
87
|
-
{
|
|
88
|
-
path: "/foobar",
|
|
89
|
-
pathParameters: [
|
|
90
|
-
{
|
|
91
|
-
name: "api_token",
|
|
92
|
-
in: "query",
|
|
93
|
-
description: "Your API token",
|
|
94
|
-
required: true
|
|
95
|
-
}
|
|
96
|
-
],
|
|
97
|
-
information: {
|
|
98
|
-
parameters: [
|
|
99
|
-
{
|
|
100
|
-
name: "id",
|
|
101
|
-
in: "query",
|
|
102
|
-
description: "A Query Parameter"
|
|
103
|
-
}
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"query"
|
|
108
|
-
);
|
|
109
|
-
expect(request).toStrictEqual([
|
|
110
|
-
{
|
|
111
|
-
name: "api_token",
|
|
112
|
-
value: "",
|
|
113
|
-
description: "Your API token",
|
|
114
|
-
required: true,
|
|
115
|
-
enabled: true
|
|
116
|
-
}
|
|
117
|
-
]);
|
|
118
|
-
});
|
|
119
|
-
it("parameters use example", () => {
|
|
120
|
-
const request = getParametersFromOperation(
|
|
121
|
-
{
|
|
122
|
-
path: "/foobar",
|
|
123
|
-
information: {
|
|
124
|
-
parameters: [
|
|
125
|
-
{
|
|
126
|
-
name: "id",
|
|
127
|
-
in: "query",
|
|
128
|
-
example: 123,
|
|
129
|
-
required: true
|
|
130
|
-
}
|
|
131
|
-
]
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
"query"
|
|
135
|
-
);
|
|
136
|
-
expect(request).toStrictEqual([
|
|
137
|
-
{
|
|
138
|
-
name: "id",
|
|
139
|
-
description: null,
|
|
140
|
-
value: 123,
|
|
141
|
-
required: true,
|
|
142
|
-
enabled: true
|
|
143
|
-
}
|
|
144
|
-
]);
|
|
145
|
-
});
|
|
146
|
-
it("path parameters", () => {
|
|
147
|
-
const request = getParametersFromOperation(
|
|
148
|
-
{
|
|
149
|
-
path: "/pet/{petId}",
|
|
150
|
-
information: {
|
|
151
|
-
parameters: [
|
|
152
|
-
{
|
|
153
|
-
name: "petId",
|
|
154
|
-
in: "path",
|
|
155
|
-
description: "Pet id to delete",
|
|
156
|
-
required: true,
|
|
157
|
-
schema: {
|
|
158
|
-
type: "integer",
|
|
159
|
-
format: "int64"
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
"path"
|
|
166
|
-
);
|
|
167
|
-
expect(request).toStrictEqual([
|
|
168
|
-
{
|
|
169
|
-
name: "petId",
|
|
170
|
-
description: "Pet id to delete",
|
|
171
|
-
value: 1,
|
|
172
|
-
required: true,
|
|
173
|
-
enabled: true
|
|
174
|
-
}
|
|
175
|
-
]);
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
//# sourceMappingURL=get-parameters-from-operation.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/spec-getters/get-parameters-from-operation.test.ts"],
|
|
4
|
-
"sourcesContent": ["import type { TransformedOperation } from '@scalar/types/legacy'\nimport { describe, expect, it } from 'vitest'\n\nimport { getParametersFromOperation } from './get-parameters-from-operation'\n\ndescribe('getParametersFromOperation', () => {\n it('operation query parameters', () => {\n const request = getParametersFromOperation(\n {\n path: '/foobar',\n information: {\n parameters: [\n {\n in: 'query',\n name: 'api_key',\n required: true,\n },\n ],\n },\n },\n 'query',\n )\n\n expect(request).toMatchObject([\n {\n name: 'api_key',\n value: '',\n },\n ])\n })\n\n it('path query parameters', () => {\n const request = getParametersFromOperation(\n {\n path: '/foobar',\n pathParameters: [\n {\n in: 'query',\n name: 'api_key',\n required: true,\n },\n ],\n },\n 'query',\n )\n\n expect(request).toMatchObject([\n {\n name: 'api_key',\n value: '',\n },\n ])\n })\n\n it('path + operation query parameters', () => {\n const request = getParametersFromOperation(\n {\n path: '/foobar',\n operationId: 'foobar',\n name: 'foobar',\n description: '',\n pathParameters: [\n {\n in: 'query',\n name: 'foo',\n required: true,\n },\n ],\n information: {\n parameters: [\n {\n in: 'query',\n name: 'bar',\n required: true,\n },\n ],\n },\n },\n 'query',\n )\n\n expect(request).toMatchObject([\n {\n name: 'foo',\n value: '',\n },\n {\n name: 'bar',\n value: '',\n },\n ])\n })\n\n it('parameters with `required` and `description`', () => {\n const request = getParametersFromOperation(\n {\n path: '/foobar',\n pathParameters: [\n {\n name: 'api_token',\n in: 'query',\n description: 'Your API token',\n required: true,\n },\n ],\n information: {\n parameters: [\n {\n name: 'id',\n in: 'query',\n description: 'A Query Parameter',\n },\n ],\n },\n } as TransformedOperation,\n 'query',\n )\n\n expect(request).toStrictEqual([\n {\n name: 'api_token',\n value: '',\n description: 'Your API token',\n required: true,\n enabled: true,\n },\n ])\n })\n\n it('parameters use example', () => {\n const request = getParametersFromOperation(\n {\n path: '/foobar',\n information: {\n parameters: [\n {\n name: 'id',\n in: 'query',\n example: 123,\n required: true,\n },\n ],\n },\n } as TransformedOperation,\n 'query',\n )\n\n expect(request).toStrictEqual([\n {\n name: 'id',\n description: null,\n value: 123,\n required: true,\n enabled: true,\n },\n ])\n })\n\n it('path parameters', () => {\n const request = getParametersFromOperation(\n {\n path: '/pet/{petId}',\n information: {\n parameters: [\n {\n name: 'petId',\n in: 'path',\n description: 'Pet id to delete',\n required: true,\n schema: {\n type: 'integer',\n format: 'int64',\n },\n },\n ],\n },\n } as TransformedOperation,\n 'path',\n )\n\n expect(request).toStrictEqual([\n {\n name: 'petId',\n description: 'Pet id to delete',\n value: 1,\n required: true,\n enabled: true,\n },\n ])\n })\n})\n"],
|
|
5
|
-
"mappings": "AACA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,kCAAkC;AAE3C,SAAS,8BAA8B,MAAM;AAC3C,KAAG,8BAA8B,MAAM;AACrC,UAAM,UAAU;AAAA,MACd;AAAA,QACE,MAAM;AAAA,QACN,aAAa;AAAA,UACX,YAAY;AAAA,YACV;AAAA,cACE,IAAI;AAAA,cACJ,MAAM;AAAA,cACN,UAAU;AAAA,YACZ;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAEA,WAAO,OAAO,EAAE,cAAc;AAAA,MAC5B;AAAA,QACE,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAED,KAAG,yBAAyB,MAAM;AAChC,UAAM,UAAU;AAAA,MACd;AAAA,QACE,MAAM;AAAA,QACN,gBAAgB;AAAA,UACd;AAAA,YACE,IAAI;AAAA,YACJ,MAAM;AAAA,YACN,UAAU;AAAA,UACZ;AAAA,QACF;AAAA,MACF;AAAA,MACA;AA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,0BAA0B,MAAM;AACjC,UAAM,UAAU;AAAA,MACd;AAAA,QACE,MAAM;AAAA,QACN,aAAa;AAAA,UACX,YAAY;AAAA,YACV;AAAA,cACE,MAAM;AAAA,cACN,IAAI;AAAA,cACJ,SAAS;AAAA,cACT,UAAU;AAAA,YACZ;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAEA,WAAO,OAAO,EAAE,cAAc;AAAA,MAC5B;AAAA,QACE,MAAM;AAAA,QACN,aAAa;AAAA,QACb,OAAO;AAAA,QACP,UAAU;AAAA,QACV,SAAS;AAAA,MACX;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAED,KAAG,mBAAmB,MAAM;AAC1B,UAAM,UAAU;AAAA,MACd;AAAA,QACE,MAAM;AAAA,QACN,aAAa;AAAA,UACX,YAAY;AAAA,YACV;AAAA,cACE,MAAM;AAAA,cACN,IAAI;AAAA,cACJ,aAAa;AAAA,cACb,UAAU;AAAA,cACV,QAAQ;AAAA,gBACN,MAAM;AAAA,gBACN,QAAQ;AAAA,cACV;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAEA,WAAO,OAAO,EAAE,cAAc;AAAA,MAC5B;AAAA,QACE,MAAM;AAAA,QACN,aAAa;AAAA,QACb,OAAO;AAAA,QACP,UAAU;AAAA,QACV,SAAS;AAAA,MACX;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { getRequestBodyFromOperation } from "./get-request-body-from-operation.js";
|
|
3
|
-
describe("getRequestBodyFromOperation", () => {
|
|
4
|
-
it("creates a JSON body from a requestBody schema", () => {
|
|
5
|
-
const body = getRequestBodyFromOperation({
|
|
6
|
-
path: "/foobar",
|
|
7
|
-
information: {
|
|
8
|
-
requestBody: {
|
|
9
|
-
content: {
|
|
10
|
-
"application/json": {
|
|
11
|
-
schema: {
|
|
12
|
-
type: "object",
|
|
13
|
-
properties: {
|
|
14
|
-
id: {
|
|
15
|
-
type: "integer",
|
|
16
|
-
example: 1
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const expectedResult = {
|
|
26
|
-
id: 1
|
|
27
|
-
};
|
|
28
|
-
expect(body).toMatchObject({
|
|
29
|
-
mimeType: "application/json",
|
|
30
|
-
text: JSON.stringify(expectedResult, null, 2)
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
it("ignores charset in mimetypes", () => {
|
|
34
|
-
const body = getRequestBodyFromOperation({
|
|
35
|
-
path: "/foobar",
|
|
36
|
-
information: {
|
|
37
|
-
requestBody: {
|
|
38
|
-
content: {
|
|
39
|
-
"application/json; charset=utf-8": {
|
|
40
|
-
schema: {
|
|
41
|
-
type: "object",
|
|
42
|
-
properties: {
|
|
43
|
-
id: {
|
|
44
|
-
type: "integer",
|
|
45
|
-
example: 1
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
const expectedResult = {
|
|
55
|
-
id: 1
|
|
56
|
-
};
|
|
57
|
-
expect(body).toMatchObject({
|
|
58
|
-
mimeType: "application/json",
|
|
59
|
-
text: JSON.stringify(expectedResult, null, 2)
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
it("creates a JSON body from body parameters", () => {
|
|
63
|
-
const body = getRequestBodyFromOperation({
|
|
64
|
-
path: "/foobar",
|
|
65
|
-
information: {
|
|
66
|
-
parameters: [
|
|
67
|
-
{
|
|
68
|
-
name: "body",
|
|
69
|
-
in: "body",
|
|
70
|
-
schema: {
|
|
71
|
-
type: "object",
|
|
72
|
-
properties: {
|
|
73
|
-
id: {
|
|
74
|
-
name: "id",
|
|
75
|
-
type: "integer",
|
|
76
|
-
example: 1
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
const expectedResult = {
|
|
85
|
-
id: 1
|
|
86
|
-
};
|
|
87
|
-
expect(body).toMatchObject({
|
|
88
|
-
mimeType: "application/json",
|
|
89
|
-
text: JSON.stringify(expectedResult, null, 2)
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
it("uses example", () => {
|
|
93
|
-
const body = getRequestBodyFromOperation({
|
|
94
|
-
path: "/foobar",
|
|
95
|
-
information: {
|
|
96
|
-
requestBody: {
|
|
97
|
-
description: "Sample request body",
|
|
98
|
-
required: false,
|
|
99
|
-
content: {
|
|
100
|
-
"application/json": {
|
|
101
|
-
example: {
|
|
102
|
-
someObject: {
|
|
103
|
-
someAttribute: "attribute1"
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
schema: {
|
|
107
|
-
$ref: "#/components/schemas/PutDocumentRequest"
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
const expectedResult = {
|
|
115
|
-
someObject: {
|
|
116
|
-
someAttribute: "attribute1"
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
expect(body).toMatchObject({
|
|
120
|
-
mimeType: "application/json",
|
|
121
|
-
text: JSON.stringify(expectedResult, null, 2)
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
it("uses examples", () => {
|
|
125
|
-
const body = getRequestBodyFromOperation({
|
|
126
|
-
path: "/foobar",
|
|
127
|
-
information: {
|
|
128
|
-
requestBody: {
|
|
129
|
-
description: "Sample request body",
|
|
130
|
-
required: false,
|
|
131
|
-
content: {
|
|
132
|
-
"application/json": {
|
|
133
|
-
examples: {
|
|
134
|
-
"request-example-1": {
|
|
135
|
-
summary: "an example of a request",
|
|
136
|
-
description: "a longer string than the summary",
|
|
137
|
-
value: {
|
|
138
|
-
someObject: {
|
|
139
|
-
someAttribute: "attribute1"
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
schema: {
|
|
145
|
-
$ref: "#/components/schemas/PutDocumentRequest"
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
const expectedResult = {
|
|
153
|
-
someObject: {
|
|
154
|
-
someAttribute: "attribute1"
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
expect(body).toMatchObject({
|
|
158
|
-
mimeType: "application/json",
|
|
159
|
-
text: JSON.stringify(expectedResult, null, 2)
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
it("creates key-value pair examples from object schema", () => {
|
|
163
|
-
const body = getRequestBodyFromOperation({
|
|
164
|
-
path: "/foobar",
|
|
165
|
-
information: {
|
|
166
|
-
requestBody: {
|
|
167
|
-
description: "Sample request body",
|
|
168
|
-
content: {
|
|
169
|
-
"application/json": {
|
|
170
|
-
schema: {
|
|
171
|
-
type: "object",
|
|
172
|
-
required: [
|
|
173
|
-
"recordString",
|
|
174
|
-
"recordInteger",
|
|
175
|
-
"recordArray",
|
|
176
|
-
"recordBoolean",
|
|
177
|
-
"recordNullable",
|
|
178
|
-
"recordObject",
|
|
179
|
-
"recordWithoutAdditionalProperties"
|
|
180
|
-
],
|
|
181
|
-
properties: {
|
|
182
|
-
recordString: {
|
|
183
|
-
type: "string"
|
|
184
|
-
},
|
|
185
|
-
recordInteger: {
|
|
186
|
-
type: "integer"
|
|
187
|
-
},
|
|
188
|
-
recordArray: {
|
|
189
|
-
type: "array"
|
|
190
|
-
},
|
|
191
|
-
recordBoolean: {
|
|
192
|
-
type: "boolean"
|
|
193
|
-
},
|
|
194
|
-
recordNullable: {
|
|
195
|
-
nullable: "true"
|
|
196
|
-
},
|
|
197
|
-
recordObject: {
|
|
198
|
-
type: "object"
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
const expectedResult = {
|
|
208
|
-
recordString: "",
|
|
209
|
-
recordInteger: 1,
|
|
210
|
-
recordArray: [],
|
|
211
|
-
recordBoolean: true,
|
|
212
|
-
recordNullable: null,
|
|
213
|
-
recordObject: {}
|
|
214
|
-
};
|
|
215
|
-
expect(body).toMatchObject({
|
|
216
|
-
mimeType: "application/json",
|
|
217
|
-
text: JSON.stringify(expectedResult, null, 2)
|
|
218
|
-
});
|
|
219
|
-
});
|
|
220
|
-
it("adds parameters from a requestBody schema", () => {
|
|
221
|
-
const body = getRequestBodyFromOperation({
|
|
222
|
-
path: "/foobar",
|
|
223
|
-
information: {
|
|
224
|
-
requestBody: {
|
|
225
|
-
content: {
|
|
226
|
-
"application/x-www-form-urlencoded": {
|
|
227
|
-
schema: {
|
|
228
|
-
type: "object",
|
|
229
|
-
properties: {
|
|
230
|
-
id: {
|
|
231
|
-
type: "integer",
|
|
232
|
-
example: 1
|
|
233
|
-
},
|
|
234
|
-
name: {
|
|
235
|
-
type: "string",
|
|
236
|
-
example: "foobar"
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
expect(body).toMatchObject({
|
|
246
|
-
mimeType: "application/x-www-form-urlencoded",
|
|
247
|
-
params: [
|
|
248
|
-
{
|
|
249
|
-
name: "id",
|
|
250
|
-
value: 1
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
name: "name",
|
|
254
|
-
value: "foobar"
|
|
255
|
-
}
|
|
256
|
-
]
|
|
257
|
-
});
|
|
258
|
-
});
|
|
259
|
-
it("handles vendor-specific MIME types", () => {
|
|
260
|
-
const body = getRequestBodyFromOperation({
|
|
261
|
-
path: "/foobar",
|
|
262
|
-
information: {
|
|
263
|
-
requestBody: {
|
|
264
|
-
content: {
|
|
265
|
-
"application/vnd.github+json": {
|
|
266
|
-
schema: {
|
|
267
|
-
type: "object",
|
|
268
|
-
properties: {
|
|
269
|
-
id: {
|
|
270
|
-
type: "integer",
|
|
271
|
-
example: 1
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
const expectedResult = {
|
|
281
|
-
id: 1
|
|
282
|
-
};
|
|
283
|
-
expect(body).toMatchObject({
|
|
284
|
-
mimeType: "application/vnd.github+json",
|
|
285
|
-
text: JSON.stringify(expectedResult, null, 2)
|
|
286
|
-
});
|
|
287
|
-
});
|
|
288
|
-
});
|
|
289
|
-
//# sourceMappingURL=get-request-body-from-operation.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/spec-getters/get-request-body-from-operation.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { getRequestBodyFromOperation } from './get-request-body-from-operation'\n\ndescribe('getRequestBodyFromOperation', () => {\n it('creates a JSON body from a requestBody schema', () => {\n const body = getRequestBodyFromOperation({\n path: '/foobar',\n information: {\n requestBody: {\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n id: {\n type: 'integer',\n example: 1,\n },\n },\n },\n },\n },\n },\n },\n })\n\n const expectedResult = {\n id: 1,\n }\n\n expect(body).toMatchObject({\n mimeType: 'application/json',\n text: JSON.stringify(expectedResult, null, 2),\n })\n })\n\n it('ignores charset in mimetypes', () => {\n const body = getRequestBodyFromOperation({\n path: '/foobar',\n information: {\n requestBody: {\n content: {\n 'application/json; charset=utf-8': {\n schema: {\n type: 'object',\n properties: {\n id: {\n type: 'integer',\n example: 1,\n },\n },\n },\n },\n },\n },\n },\n })\n\n const expectedResult = {\n id: 1,\n }\n\n expect(body).toMatchObject({\n mimeType: 'application/json',\n text: JSON.stringify(expectedResult, null, 2),\n })\n })\n\n it('creates a JSON body from body parameters', () => {\n const body = getRequestBodyFromOperation({\n path: '/foobar',\n information: {\n parameters: [\n {\n name: 'body',\n in: 'body',\n schema: {\n type: 'object',\n properties: {\n id: {\n name: 'id',\n type: 'integer',\n example: 1,\n },\n },\n },\n },\n ],\n },\n })\n\n const expectedResult = {\n id: 1,\n }\n\n expect(body).toMatchObject({\n mimeType: 'application/json',\n text: JSON.stringify(expectedResult, null, 2),\n })\n })\n\n it('uses example', () => {\n const body = getRequestBodyFromOperation({\n path: '/foobar',\n information: {\n requestBody: {\n description: 'Sample request body',\n required: false,\n content: {\n 'application/json': {\n example: {\n someObject: {\n someAttribute: 'attribute1',\n },\n },\n schema: {\n $ref: '#/components/schemas/PutDocumentRequest',\n },\n },\n },\n },\n },\n })\n\n const expectedResult = {\n someObject: {\n someAttribute: 'attribute1',\n },\n }\n\n expect(body).toMatchObject({\n mimeType: 'application/json',\n text: JSON.stringify(expectedResult, null, 2),\n })\n })\n\n it('uses examples', () => {\n const body = getRequestBodyFromOperation({\n path: '/foobar',\n information: {\n requestBody: {\n description: 'Sample request body',\n required: false,\n content: {\n 'application/json': {\n examples: {\n 'request-example-1': {\n summary: 'an example of a request',\n description: 'a longer string than the summary',\n value: {\n someObject: {\n someAttribute: 'attribute1',\n },\n },\n },\n },\n schema: {\n $ref: '#/components/schemas/PutDocumentRequest',\n },\n },\n },\n },\n },\n })\n\n const expectedResult = {\n someObject: {\n someAttribute: 'attribute1',\n },\n }\n\n expect(body).toMatchObject({\n mimeType: 'application/json',\n text: JSON.stringify(expectedResult, null, 2),\n })\n })\n\n it('creates key-value pair examples from object schema', () => {\n const body = getRequestBodyFromOperation({\n path: '/foobar',\n information: {\n requestBody: {\n description: 'Sample request body',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n required: [\n 'recordString',\n 'recordInteger',\n 'recordArray',\n 'recordBoolean',\n 'recordNullable',\n 'recordObject',\n 'recordWithoutAdditionalProperties',\n ],\n properties: {\n recordString: {\n type: 'string',\n },\n recordInteger: {\n type: 'integer',\n },\n recordArray: {\n type: 'array',\n },\n recordBoolean: {\n type: 'boolean',\n },\n recordNullable: {\n nullable: 'true',\n },\n recordObject: {\n type: 'object',\n },\n },\n },\n },\n },\n },\n },\n })\n\n const expectedResult = {\n recordString: '',\n recordInteger: 1,\n recordArray: [],\n recordBoolean: true,\n recordNullable: null,\n recordObject: {},\n }\n\n expect(body).toMatchObject({\n mimeType: 'application/json',\n text: JSON.stringify(expectedResult, null, 2),\n })\n })\n\n it('adds parameters from a requestBody schema', () => {\n const body = getRequestBodyFromOperation({\n path: '/foobar',\n information: {\n requestBody: {\n content: {\n 'application/x-www-form-urlencoded': {\n schema: {\n type: 'object',\n properties: {\n id: {\n type: 'integer',\n example: 1,\n },\n name: {\n type: 'string',\n example: 'foobar',\n },\n },\n },\n },\n },\n },\n },\n })\n\n expect(body).toMatchObject({\n mimeType: 'application/x-www-form-urlencoded',\n params: [\n {\n name: 'id',\n value: 1,\n },\n {\n name: 'name',\n value: 'foobar',\n },\n ],\n })\n })\n\n it('handles vendor-specific MIME types', () => {\n const body = getRequestBodyFromOperation({\n path: '/foobar',\n information: {\n requestBody: {\n content: {\n 'application/vnd.github+json': {\n schema: {\n type: 'object',\n properties: {\n id: {\n type: 'integer',\n example: 1,\n },\n },\n },\n },\n },\n },\n },\n })\n\n const expectedResult = {\n id: 1,\n }\n\n expect(body).toMatchObject({\n mimeType: 'application/vnd.github+json',\n text: JSON.stringify(expectedResult, null, 2),\n })\n })\n})\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,mCAAmC;AAE5C,SAAS,+BAA+B,MAAM;AAC5C,KAAG,iDA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