From f4cb4be0d9a27d8799b209eeb70db38bd80d5f57 Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:36:47 +0000 Subject: [PATCH] Updated API from documentation release --- api-specs/test/CHANGELOG.md | 66 ++ .../test/annotation-types/annotations.raml | 54 ++ api-specs/test/api.raml | 571 ++++++++++++++++++ api-specs/test/examples/action-success.json | 81 +++ .../examples/array-test-type-custom-1.json | 18 + .../examples/array-test-type-custom-2.json | 18 + api-specs/test/examples/array-test-type.json | 18 + api-specs/test/examples/date-test-type.json | 8 + .../do-something-on-example-resource.json | 3 + .../test/examples/example-nonconforming.json | 5 + .../examples/example-resource-update.json | 12 + api-specs/test/examples/example.json | 5 + .../json-serializable-primitive-object.json | 1 + .../json-serializable-primitive-raw.json | 1 + .../test/examples/object-test-type-draft.json | 20 + api-specs/test/examples/object-test-type.json | 21 + .../out-of-order-properties-test-type.json | 24 + api-specs/test/examples/product-example.json | 106 ++++ api-specs/test/examples/string-test-type.json | 3 + api-specs/test/security-schemes/oauth2.raml | 23 + .../test/types/annotations-test-type.raml | 21 + api-specs/test/types/any-properties-type.raml | 10 + api-specs/test/types/any-test-type.raml | 10 + api-specs/test/types/arrays.raml | 95 +++ api-specs/test/types/constants.raml | 27 + api-specs/test/types/date-test-type.raml | 34 ++ .../types/descriptions-with-urn-links.raml | 12 + api-specs/test/types/enums.raml | 112 ++++ api-specs/test/types/examples.raml | 114 ++++ api-specs/test/types/link-test-types.raml | 23 + api-specs/test/types/objects.raml | 21 + .../types/optional-property-test-type.raml | 19 + .../out-of-order-properties-test-type.raml | 67 ++ api-specs/test/types/references.raml | 147 +++++ .../types/regex-properties-type-array.raml | 15 + .../types/regex-properties-type-object.raml | 14 + .../types/regex-properties-type-string.raml | 11 + api-specs/test/types/scalars.raml | 66 ++ api-specs/test/types/soft-links.raml | 114 ++++ api-specs/test/types/type-overrides.raml | 14 + api-specs/test/types/unions.raml | 59 ++ 41 files changed, 2063 insertions(+) create mode 100644 api-specs/test/CHANGELOG.md create mode 100644 api-specs/test/annotation-types/annotations.raml create mode 100644 api-specs/test/api.raml create mode 100644 api-specs/test/examples/action-success.json create mode 100644 api-specs/test/examples/array-test-type-custom-1.json create mode 100644 api-specs/test/examples/array-test-type-custom-2.json create mode 100644 api-specs/test/examples/array-test-type.json create mode 100644 api-specs/test/examples/date-test-type.json create mode 100644 api-specs/test/examples/do-something-on-example-resource.json create mode 100644 api-specs/test/examples/example-nonconforming.json create mode 100644 api-specs/test/examples/example-resource-update.json create mode 100644 api-specs/test/examples/example.json create mode 100644 api-specs/test/examples/json-serializable-primitive-object.json create mode 100644 api-specs/test/examples/json-serializable-primitive-raw.json create mode 100644 api-specs/test/examples/object-test-type-draft.json create mode 100644 api-specs/test/examples/object-test-type.json create mode 100644 api-specs/test/examples/out-of-order-properties-test-type.json create mode 100644 api-specs/test/examples/product-example.json create mode 100644 api-specs/test/examples/string-test-type.json create mode 100644 api-specs/test/security-schemes/oauth2.raml create mode 100644 api-specs/test/types/annotations-test-type.raml create mode 100644 api-specs/test/types/any-properties-type.raml create mode 100644 api-specs/test/types/any-test-type.raml create mode 100644 api-specs/test/types/arrays.raml create mode 100644 api-specs/test/types/constants.raml create mode 100644 api-specs/test/types/date-test-type.raml create mode 100644 api-specs/test/types/descriptions-with-urn-links.raml create mode 100644 api-specs/test/types/enums.raml create mode 100644 api-specs/test/types/examples.raml create mode 100644 api-specs/test/types/link-test-types.raml create mode 100644 api-specs/test/types/objects.raml create mode 100644 api-specs/test/types/optional-property-test-type.raml create mode 100644 api-specs/test/types/out-of-order-properties-test-type.raml create mode 100644 api-specs/test/types/references.raml create mode 100644 api-specs/test/types/regex-properties-type-array.raml create mode 100644 api-specs/test/types/regex-properties-type-object.raml create mode 100644 api-specs/test/types/regex-properties-type-string.raml create mode 100644 api-specs/test/types/scalars.raml create mode 100644 api-specs/test/types/soft-links.raml create mode 100644 api-specs/test/types/type-overrides.raml create mode 100644 api-specs/test/types/unions.raml diff --git a/api-specs/test/CHANGELOG.md b/api-specs/test/CHANGELOG.md new file mode 100644 index 000000000..78b9a75f3 --- /dev/null +++ b/api-specs/test/CHANGELOG.md @@ -0,0 +1,66 @@ +# @commercetools-api-specs/test + +## 0.3.0 + +### Minor Changes + +- [#2076](https://github.com/commercetools/commercetools-docs-kit/pull/2076) [`dbe4950`](https://github.com/commercetools/commercetools-docs-kit/commit/dbe49500fa962cc3d6d4a51e79f8eade8b46271d) Thanks [@timonrey](https://github.com/timonrey)! - Add API OAuth scopes columns layout + +## 0.2.3 + +### Patch Changes + +- [#1983](https://github.com/commercetools/commercetools-docs-kit/pull/1983) [`2f83a52`](https://github.com/commercetools/commercetools-docs-kit/commit/2f83a526443b2545e7cdc4aa820fc8dbe965e3a2) Thanks [@gabriele-ct](https://github.com/gabriele-ct)! - Correctly handle type field when the name is reserved word 'enum' + +## 0.2.2 + +### Patch Changes + +- [#1960](https://github.com/commercetools/commercetools-docs-kit/pull/1960) [`ad4437b`](https://github.com/commercetools/commercetools-docs-kit/commit/ad4437b9c9112524c4b74df8d98423393c8d6688) Thanks [@gabriele-ct](https://github.com/gabriele-ct)! - apply ui changes for learning go live + +## 0.2.1 + +### Patch Changes + +- [#1661](https://github.com/commercetools/commercetools-docs-kit/pull/1661) [`8759c1ea`](https://github.com/commercetools/commercetools-docs-kit/commit/8759c1ea7fdf07c3c25abc041bd1dfb941bce409) Thanks [@gabriele-ct](https://github.com/gabriele-ct)! - Add support for primitive and generic JSON types in API request and response + +## 0.2.0 + +### Minor Changes + +- [#1448](https://github.com/commercetools/commercetools-docs-kit/pull/1448) [`8266d506`](https://github.com/commercetools/commercetools-docs-kit/commit/8266d5064a27b8c29460e28187ac8a224d21ad5b) Thanks [@gabriele-ct](https://github.com/gabriele-ct)! - Display nicely multiple types (union) in API parameters + +- [#1445](https://github.com/commercetools/commercetools-docs-kit/pull/1445) [`ae9d441a`](https://github.com/commercetools/commercetools-docs-kit/commit/ae9d441a1acf5289724281a16680795d1ea1167b) Thanks [@gabriele-ct](https://github.com/gabriele-ct)! - Add support for endpoint URN resolution in links. As per type URN, an override mechanism is provided and documented + +## 0.1.0 + +### Minor Changes + +- [#1331](https://github.com/commercetools/commercetools-docs-kit/pull/1331) [`9dfa5e73`](https://github.com/commercetools/commercetools-docs-kit/commit/9dfa5e7341eddafe876e33b390c4b22de64b41f3) Thanks [@gabriele-ct](https://github.com/gabriele-ct)! - When an API endpoint method response has one or more `example` nodes defined in the .raml file, those examples will be displayed in the API method page. In case no `example` nodes are defined, the response type example will be displayed instead. + The API response code is now visible in the example code section header to help identifying what the example is referring to. + +## 0.0.4 + +### Patch Changes + +- [#1198](https://github.com/commercetools/commercetools-docs-kit/pull/1198) [`fdc249d5`](https://github.com/commercetools/commercetools-docs-kit/commit/fdc249d5df2198dacea00bf26573bdbf684519f3) Thanks [@renovate](https://github.com/apps/renovate)! - Update dependencies + +## 0.0.3 + +### Patch Changes + +- [#1145](https://github.com/commercetools/commercetools-docs-kit/pull/1145) [`424806a`](https://github.com/commercetools/commercetools-docs-kit/commit/424806a8fedeacc33b2fa9ce68a353049ef0c42a) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update all dependencies + +* [#1152](https://github.com/commercetools/commercetools-docs-kit/pull/1152) [`795b5cc`](https://github.com/commercetools/commercetools-docs-kit/commit/795b5ccd3141220031c4aa3dca2f42b7b2e9d572) Thanks [@emmenko](https://github.com/emmenko)! - Upgrade to Yarn v3 + +## 0.0.2 + +### Patch Changes + +- [#1018](https://github.com/commercetools/commercetools-docs-kit/pull/1018) [`853f891`](https://github.com/commercetools/commercetools-docs-kit/commit/853f8915072f8153fd1efa266b06b66f0360717a) Thanks [@nkuehn](https://github.com/nkuehn)! - Resolve URN style links in RAML descriptions + +## 0.0.1 + +### Patch Changes + +- [`b0dcc19`](https://github.com/commercetools/commercetools-docs-kit/commit/b0dcc1989983043331eb5deb77a6ba40befe51b0) [#866](https://github.com/commercetools/commercetools-docs-kit/pull/866) Thanks [@emmenko](https://github.com/emmenko)! - Update uikit versions to latest diff --git a/api-specs/test/annotation-types/annotations.raml b/api-specs/test/annotation-types/annotations.raml new file mode 100644 index 000000000..28a85c2e1 --- /dev/null +++ b/api-specs/test/annotation-types/annotations.raml @@ -0,0 +1,54 @@ +#%RAML 1.0 Library +usage: Generator annotation types. + +annotationTypes: + enumDescriptions: + description: | + Describes the values of an enum type. + type: object + properties: + //: + description: | + Adds a description for the enum value given by the key. + enumGroups: + description: | + Groups the values of an enum type. + type: object + properties: + //: + description: | + Specifies the group for the enum value given by the key. + beta: + description: | + if true, designates that the element is not released yet like regular elements and should be treated as being subject to + changes, incompleteness and ongoing development. + Documentation must provide a hint that the element is in beta status and can opt to hide such elements. + If not set, false must be assumed. + type: boolean + deprecated: + description: | + If true, designates that the element carrying this annotation should not be used any more and is subject to potential later removal. + If used, the description text should explain the new way the effect of the deprecated element is to be achieved. + If not set, false must be assumed. + Documentation can choose to hide deprecated elements, mark them deprecated or make them less prominent as needed. + Documentation must not suppress the fact that an element is deprecated. + type: boolean + refersTo: + description: | + Must contain either a type name in the current API or a detectable addressing scheme like URN or URL pointing to other entities. + if the `refersTo` annotation is used on a RAML element it designates that the element is referring, linking or pointing to another type of entity. + Documentation should generate a navigatable link to that other entity. + type: string + docsBaseUri: + allowedTargets: + - API + type: string + docsBaseUriParameters: + allowedTargets: + - API + type: object +## Reminder for future needs: +# messagesEmitted: +# description: | +# list of messages emitted by an endpoint (Strings?) +# type: String[] diff --git a/api-specs/test/api.raml b/api-specs/test/api.raml new file mode 100644 index 000000000..bfdbc40b2 --- /dev/null +++ b/api-specs/test/api.raml @@ -0,0 +1,571 @@ +#%RAML 1.0 +--- +title: Commercetools Test API Spec +version: v0.1 beta +mediaType: application/json +baseUri: https://api.regionOne.providerOne.commercetools.com +(annotations.docsBaseUri): https://api.{region}.{cloudProvider}.commercetools.com +(annotations.docsBaseUriParameters): + region: + type: string + required: true + enum: + - regionOne + - regionTwo + - regionThree + description: | + Free text description of the uri parameter. + cloudProvider: + type: string + required: true + enum: + - providerOne + - providerTwo + - providerThree + description: | + Free text description of the uri parameter. +securitySchemes: + oauth_2_0: !include security-schemes/oauth2.raml +securedBy: [oauth_2_0] + +# This API represents a series of test cases from which to generate API documentation + +uses: + annotations: annotation-types/annotations.raml + annotations-test-type: types/annotations-test-type.raml + any-properties-type: types/any-properties-type.raml + any-test-type: types/any-test-type.raml + arrays: types/arrays.raml + constants: types/constants.raml + date-test-type: types/date-test-type.raml + descriptions-with-urn-links: types/descriptions-with-urn-links.raml + enums: types/enums.raml + examples: types/examples.raml + link-test-types: types/link-test-types.raml + type-overrides: types/type-overrides.raml + objects: types/objects.raml + optional-property-test-type: types/optional-property-test-type.raml + out-of-order-properties-test-type: types/out-of-order-properties-test-type.raml + references: types/references.raml + regex-properties-type-string: types/regex-properties-type-string.raml + regex-properties-type-object: types/regex-properties-type-object.raml + regex-properties-type-array: types/regex-properties-type-array.raml + scalars: types/scalars.raml + soft-links: types/soft-links.raml + unions: types/unions.raml + +# Endpoints ("Resources" in RAML and HTTP terminology) +# Every CT API endpoint starts at this root +/{projectKey}: + uriParameters: + projectKey: + description: The CTP project key. + type: string + /resource: + post: + displayName: Create or Update a Resource + description: Create or Update (POST) operation to a resource. + securedBy: + - oauth_2_0: + scopes: + [ + 'manage_test:{projectKey}', + 'customer_id_test:{id}', + 'manage_my_profile_test:{projectKey}', + 'customer_id_test:{id}', + 'manage_my_profile_test:{projectKey}', + 'manage_test:{projectKey}', + 'manage_my_profile_test:{projectKey}', + 'customer_id_test:{id}', + 'manage_test:{projectKey}', + 'manage_my_profile_test:{projectKey}', + 'customer_id_test:{id}', + 'manage_my_profile_test:{projectKey}', + ] + body: + type: objects.ObjectTestTypeDraft + example: !include examples/object-test-type-draft.json + responses: + 201: + description: 201 Created response. This is the success response when creating something. + body: + type: objects.ObjectTestType + example: !include examples/object-test-type.json + head: + displayName: Check for existence + description: Check if at least one resource exists matching the query condition. + queryParameters: + stringParameter: + type: string + required: false + default: test + example: 6 in arrayOfIntExample + booleanParameter: + type: boolean + required: false + default: false + floatParameter: + type: number + required: false + default: 10 + example: 50 + integerParameter: + type: integer + required: false + default: 5 + example: 50 + withMarkdownDescription: + type: number + description: This `markdown` should be parsed correctly. + required: false + default: 1500 + example: 50 + objectParameter: + type: objects.ObjectTestType + required: false + arrayOfString: + type: string[] + required: false + arrayOfStringWithDescription: + description: This should render above the text "The parameter can be passed multiple times." + type: string[] + required: false + securedBy: + - oauth_2_0: + scopes: ['manage_test:{projectKey}', 'view_test:{projectKey}'] + responses: + 200: + description: A 200 response. This is the case when reading or modifying something. + put: + displayName: Create or Overwrite a Resource + description: Create or Overwrite (PUT) operation to a resource. + securedBy: + - oauth_2_0: + scopes: ['manage_test:{projectKey}'] + body: + type: objects.ObjectTestTypeDraft + responses: + 201: + description: 201 Created response. This is the success response when creating something. + body: + type: objects.ObjectTestType + patch: + displayName: Overwrite a Resource + description: Overwrite (PATCH) operation to a resource. + securedBy: + - oauth_2_0: + scopes: ['manage_test:{projectKey}'] + body: + type: objects.ObjectTestTypeDraft + responses: + 201: + description: 201 Created response. This is the success response when creating something. + body: + type: objects.ObjectTestType + get: + displayName: Get all resources + description: Query/retrieve (GET) a specific resource or resource(s). This should return a paged query result of _blah_. + queryParameters: + stringParameter: + type: string + required: false + example: 6 in arrayOfIntExample + floatParameter: + type: number + required: false + example: 50 + integerParameter: + type: integer + required: false + example: 50 + withMarkdownDescription: + type: number + description: This `markdown` should be parsed correctly. + required: false + example: 50 + objectParameter: + type: objects.ObjectTestType + required: false + arrayOfString: + type: string[] + required: false + arrayOfStringWithDescription: + description: This should render above the text "The parameter can be passed multiple times." + type: string[] + required: false + unionParameter: + type: number | datetime | objects.ObjectTestType + required: false + securedBy: + - oauth_2_0: + scopes: ['manage_test:{projectKey}', 'view_test:{projectKey}'] + responses: + 200: + description: A 200 response. This is the case when reading or modifying something. + body: + type: arrays.ArrayTestType + example: !include examples/array-test-type.json + /{id}: + post: + displayName: Update a Resource by ID + description: Update a resource by ID + body: + type: examples.ExampleResourceUpdate + example: !include examples/example-resource-update.json + get: + displayName: Get a Resource by its ID + description: Query by ID + securedBy: + - oauth_2_0: + scopes: ['manage_test:{projectKey}', 'view_test:{projectKey}'] + queryParameters: + optionalQueryParameter: + required: false + type: string + description: | + This is a query parameter. + example: optional + secondOptionalQueryParameter: + required: false + type: string + description: | + This is another query parameter. + example: second optional + responses: + 200: + body: + type: objects.ObjectTestType + example: !include examples/object-test-type.json + delete: + displayName: Delete a Resource by its ID + description: Deletes a resource. + securedBy: + - oauth_2_0: + scopes: ['manage_test:{projectKey}'] + responses: + 200: + description: Deletion was successful. + body: + type: objects.ObjectTestType + example: !include examples/object-test-type.json + /key={key}: + get: + displayName: Get a Resource by its Key + description: Query by key. Has three responses to see the difference between modeling patterns in RAML + securedBy: + [ + oauth_2_0: + { + scopes: ['manage_test:{projectKey}', 'view_test:{projectKey}'], + }, + ] + responses: + 200: + description: this is directly using a named type without messing with it, thats how we want to use RAML + body: + type: objects.ObjectTestType + example: !include examples/object-test-type.json + 502: + body: + type: scalars.StringTestType + example: !include examples/string-test-type.json + + /artificially-complex/path/uri-parameter-one={uriParameterOne}/{uriParameterTwo}: + description: Artificial Endpoint constructing a high complexity of what could theoretically come together in one API + (annotations.beta): true + uriParameters: + uriParameterOne: + type: string + description: A Path parameter in the equal-sign-pseudo-query notation + example: lastName = "Doe" + uriParameterTwo: + type: string + description: A Path parameter as a plain variable path element + example: plain + post: + description: Updates the resource. OutOfOrderPropertiesTestType is used because it is big and long. + queryParameters: + queryParameterOne: + type: number + description: some parameter to construct a combination of URI and query params + required: false + example: 1 + queryParameterTwo: + type: string + required: false + example: string-path + body: + type: out-of-order-properties-test-type.OutOfOrderPropertiesTestType + example: !include examples/out-of-order-properties-test-type.json + responses: + 200: + description: ArrayTestType is used because it is big and long. + body: + type: arrays.ArrayTestType + example: !include examples/array-test-type-custom-1.json + + 201: + description: ArrayTestType using type example + body: + type: arrays.ArrayTestType + + 203: + description: ArrayTestType using 2 different custom example files + body: + application/x-www-form-urlencoded: + type: arrays.ArrayTestType + examples: + custom1: !include examples/array-test-type-custom-1.json + custom2: !include examples/array-test-type-custom-2.json + + /description-with-urn-links: + post: + description: This link - [ObjectTestTypeDraft](ctp:test:type:ObjectTestTypeDraft), `[ObjectTestTypeDraft](ctp:test:type:ObjectTestTypeDraft)`, must be auto-generated. + queryParameters: + queryParameterOne: + type: number + description: This link - [StringTestType](ctp:test:type:StringTestType), `[StringTestType](ctp:test:type:StringTestType)`, must be auto-generated. + required: false + example: 1 + queryParameterTwo: + type: string + required: false + example: string-path + body: + type: out-of-order-properties-test-type.OutOfOrderPropertiesTestType + example: !include examples/out-of-order-properties-test-type.json + responses: + 200: + description: ArrayTestType is used because it is big and long. + body: + type: arrays.ArrayTestType + example: !include examples/array-test-type.json + 202: + description: | + DateTestType is used because it is big and long + This is not used by commercetools but a valid 2xx response that says that it will process the stuff later. + It's here to check how we handle multiple "OK" style response options. + body: + type: date-test-type.DateTestType + example: !include examples/date-test-type.json + + /product-projection-search: + post: + displayName: Search Products by post + securedBy: + [ + oauth_2_0: + { + scopes: + [ + 'view_products:{projectKey}', + 'view_published_products:{projectKey}', + ], + }, + ] + description: Search Product Projection with content type `application/x-www-form-urlencoded`. + body: + application/x-www-form-urlencoded: + type: scalars.StringTestType + responses: + 200: + body: + application/json: + type: scalars.StringTestType + 201: + body: + type: date-test-type.DateTestType + + /searchApiPattern: + get: + displayName: Search Resources + description: Search all resources by specific parameters. + securedBy: + - oauth_2_0: + scopes: ['manage_test:{projectKey}', 'view_test:{projectKey}'] + queryParameters: + fuzzy?: + type: boolean + description: Whether to apply fuzzy search on the text to analyze. + example: true + fuzzyLevel?: + type: number + description: | + Provide explicitly the fuzzy level desired if fuzzy is enabled. This value can not be higher than the one + chosen by the platform by default. + example: 7 + staged?: + type: boolean + description: Whether to query for the current or staged projections. + example: true + filter?: + type: string + example: bodyMassIndex + filter.facets?: + type: string + example: weight,height + filter.query?: + type: string + example: lastName = Doe + facet?: + type: string + /text\.[a-z]{2}(-[A-Z]{2})?/: + type: string + required: false + example: en + + /sorted-query-parameters: + get: + displayName: Sorted Query Parameters + description: Query parameters should be sorted as in the description of each parameter. + securedBy: + - oauth_2_0: + scopes: ['manage_test:{projectKey}', 'view_test:{projectKey}'] + queryParameters: + expand?: + type: objects.ObjectTestType[] + description: Should display 6th (1st in RAML) + where?: + type: objects.ObjectTestType[] + description: Should display 1st (2nd in RAML) + sort?: + type: objects.ObjectTestType[] + description: Should display 2nd (3rd in RAML) + limit?: + type: number + description: Should display 3rd (4th in RAML) + example: 500 + offset?: + type: number + description: Should display 4th (5th in RAML) + example: 5 + /^var[.][a-zA-Z0-9]+$/: + type: string[] + required: false + description: Should display 7th (6th in RAML) + withTotal?: + type: boolean + description: Should display 5th (7th in RAML) + example: true + + /images: + post: + displayName: Upload a product image + queryParameters: + filename?: + type: string + variant?: + type: number + format: int64 + sku?: + type: string + staged?: + type: boolean + description: | + Uploads a binary image file to a given product variant. The supported image formats are JPEG, PNG and GIF. + securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }] + body: + image/jpeg: + type: file + image/png: + type: file + image/gif: + type: file + headers: + Content-Type: + enum: ['image/jpeg', 'image/png', 'image/gif'] + responses: + 200: + body: + application/json: + type: objects.ObjectTestType + 202: + body: + application/json: + type: scalars.StringTestType + + /namespace-action: + uriParameters: + namespace: + displayName: Namespace + type: string + description: Namespace + action: + displayName: Action + type: string + description: Action + get: + description: Use the GET method to allow the frontend to fetch data asynchronously. + responses: + 200: + description: We recommend to use standard HTTP response codes and `application/json` encoded content. + post: + description: Use the POST method to write data to a backend system. + responses: + 200: + description: We recommend to use standard HTTP response codes and `application/json` encoded content. + + /namespace-action-with-example: + get: + description: Use the GET method to allow the frontend to fetch data asynchronously. The example fetches a cart. + responses: + 200: + description: We recommend to use standard HTTP response codes and `application/json` encoded content. The response will look like the response you have declared in your action. As an example we will fetch the cart. + body: + application/json: + type: object + example: !include examples/action-success.json + + /namespace-action-with-headers: + uriParameters: + namespace: + displayName: Namespace + type: string + description: The namespace where the action to invoked is located. + action: + displayName: Action + type: string + description: The name of the action to invoked. + get: + headers: + Accept: + displayName: Accept Header + type: string + description: Accept application/json Header. + required: true + pattern: application/json + default: application/json + Test-Header: + displayName: Header with special type. + type: objects.ObjectTestType + description: A header with a special type. + Path-Header: + displayName: Path Header + type: string + required: true + pattern: ^/.*$ + description: Use the GET method to allow the frontend to fetch data from a backend system. For the response, we recommend to use standard HTTP codes and `application/json` encoded content. The response will be structured as defined by the body property of the action. + responses: + 200: + description: The response will be structured as defined by the body property of the action. + body: + application/json: + type: object + example: !include examples/action-success.json + + /json-serializable-primitive-type: + put: + description: Use the PUT method to write data to a backend system. Any JSON serializable payload is accepted. The following request example adds a product to a cart. For the response, we recommend to use standard HTTP codes and `application/json` encoded content. The response will be structured [as defined by the `body` property of the action](/). The following response example contains the updated cart information, which includes the added product. + body: + application/json: + type: object + example: !include examples/json-serializable-primitive-object.json + responses: + 200: + description: We recommend to use standard HTTP response codes and `application/json` encoded content. The response will look like the response you have declared in your action. As an example we will fetch the cart. + body: + application/json: + type: any + example: !include examples/json-serializable-primitive-raw.json +# /resourceWithHeaders: +# description: Tests use of specific headers. diff --git a/api-specs/test/examples/action-success.json b/api-specs/test/examples/action-success.json new file mode 100644 index 000000000..cdfe6a1fe --- /dev/null +++ b/api-specs/test/examples/action-success.json @@ -0,0 +1,81 @@ +{ + "cartId": "534a5f86-ea14-4b54-b2da-62a0672707e1", + "cartVersion": "15", + "lineItems": [ + { + "lineItemId": "d41690bc-ea20-4254-b10b-8dxeac87c1b0", + "productId": "6bgggaf4-c2b8-4ba7-945e-95e2a113a41f", + "name": "Casual jacket", + "type": "variant", + "count": 1, + "price": { + "fractionDigits": 2, + "centAmount": 39900, + "currencyCode": "EUR" + }, + "discountTexts": [], + "discounts": [], + "totalPrice": { + "fractionDigits": 2, + "centAmount": 39900, + "currencyCode": "EUR" + }, + "variant": { + "id": "1", + "sku": "M0E200KJ1200DSDJ", + "images": ["https://your-storage.com/images/casual_jacket.jpg"], + "groupId": "78d95", + "attributes": { + "articleNumberManufacturer": "621840423 V0065", + "articleNumberMax": "78665", + "matrixId": "M0E200KJ1200DSDJ", + "baseId": "78665", + "designer": { + "key": "casual", + "label": "casual" + }, + "madeInItaly": { + "key": "no", + "label": "no" + }, + "commonSize": { + "key": "xxs", + "label": "XXS" + }, + "size": "XXS", + "color": { + "key": "black", + "label": "Black" + }, + "colorFreeDefinition": "black", + "style": { + "key": "sporty", + "label": "sporty" + }, + "gender": { + "key": "men", + "label": "Men" + }, + "season": "S15" + }, + "price": { + "fractionDigits": 2, + "centAmount": 39900, + "currencyCode": "EUR" + }, + "isOnStock": true + }, + "isGift": false, + "_url": "/slug/p/M0E200KJ1200DSDJ" + } + ], + "sum": { + "fractionDigits": 2, + "centAmount": 39900, + "currencyCode": "EUR" + }, + "shippingAddress": {}, + "billingAddress": {}, + "payments": [], + "discountCodes": [] +} diff --git a/api-specs/test/examples/array-test-type-custom-1.json b/api-specs/test/examples/array-test-type-custom-1.json new file mode 100644 index 000000000..a0697b784 --- /dev/null +++ b/api-specs/test/examples/array-test-type-custom-1.json @@ -0,0 +1,18 @@ +{ + "arrayOfIntExample": [1, 2, 3], + "arrayOfUniqueIntExample": [4, 6], + "arrayOfTwonumbersExample": [6, 10], + "arrayOfFloatExample": [0.65], + "arrayOfNumberNoDefaultsExample": [30], + "arrayOfStringExample": ["custom", "example", "file", "1"], + "arrayOfObjectType": [ + { + "integerExample": 1, + "integerExampleInt32": 3 + }, + { + "integerExample": 4, + "integerExampleInt32": 44 + } + ] +} diff --git a/api-specs/test/examples/array-test-type-custom-2.json b/api-specs/test/examples/array-test-type-custom-2.json new file mode 100644 index 000000000..04f657f0f --- /dev/null +++ b/api-specs/test/examples/array-test-type-custom-2.json @@ -0,0 +1,18 @@ +{ + "arrayOfIntExample": [4, 5, 6], + "arrayOfUniqueIntExample": [8, 26], + "arrayOfTwonumbersExample": [12, 20], + "arrayOfFloatExample": [1.3], + "arrayOfNumberNoDefaultsExample": [60], + "arrayOfStringExample": ["custom", "example", "file", "2"], + "arrayOfObjectType": [ + { + "integerExample": 2, + "integerExampleInt32": 6 + }, + { + "integerExample": 8, + "integerExampleInt32": 88 + } + ] +} diff --git a/api-specs/test/examples/array-test-type.json b/api-specs/test/examples/array-test-type.json new file mode 100644 index 000000000..27a09e513 --- /dev/null +++ b/api-specs/test/examples/array-test-type.json @@ -0,0 +1,18 @@ +{ + "arrayOfIntExample": [2, 4, 2, 6, 4, 6, 2], + "arrayOfUniqueIntExample": [2, 6, 10, 14], + "arrayOfTwonumbersExample": [6, 10], + "arrayOfFloatExample": [1.64], + "arrayOfNumberNoDefaultsExample": [20, 18, 16, 14, 12], + "arrayOfStringExample": ["dogdog", "catcat", "birdbird"], + "arrayOfObjectType": [ + { + "integerExample": 1554, + "integerExampleInt32": 2 + }, + { + "integerExample": 60000, + "integerExampleInt32": 22 + } + ] +} \ No newline at end of file diff --git a/api-specs/test/examples/date-test-type.json b/api-specs/test/examples/date-test-type.json new file mode 100644 index 000000000..39fe4e31f --- /dev/null +++ b/api-specs/test/examples/date-test-type.json @@ -0,0 +1,8 @@ +{ + "dateOnlyExample": "2015-05-23", + "timeOnlyExample": "12:30:00", + "dateTimeOnlyExample": "2015-07-04T21:00:00", + "dateTimeExample": "2016-02-28T16:41:41.090Z", + "dateTimeExampleDefaultFormat": "2016-02-28T16:41:41.090Z", + "dateTimeExampleRfc": "Sun, 28 Feb 2016 16:41:41 GMT" +} \ No newline at end of file diff --git a/api-specs/test/examples/do-something-on-example-resource.json b/api-specs/test/examples/do-something-on-example-resource.json new file mode 100644 index 000000000..7bc81d87f --- /dev/null +++ b/api-specs/test/examples/do-something-on-example-resource.json @@ -0,0 +1,3 @@ +{ + "action": "doSomeThing" +} \ No newline at end of file diff --git a/api-specs/test/examples/example-nonconforming.json b/api-specs/test/examples/example-nonconforming.json new file mode 100644 index 000000000..80fa823fd --- /dev/null +++ b/api-specs/test/examples/example-nonconforming.json @@ -0,0 +1,5 @@ +{ +"foo-wrong": "name wrong", +"baz": "should be an integer", +"boo": null +} diff --git a/api-specs/test/examples/example-resource-update.json b/api-specs/test/examples/example-resource-update.json new file mode 100644 index 000000000..a5340e5d0 --- /dev/null +++ b/api-specs/test/examples/example-resource-update.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "actions": [ + { + "action": "doSomeThing" + }, + { + "action": "changeSomeProperty", + "someProperty": "any string" + } + ] +} diff --git a/api-specs/test/examples/example.json b/api-specs/test/examples/example.json new file mode 100644 index 000000000..ee4e2f6b0 --- /dev/null +++ b/api-specs/test/examples/example.json @@ -0,0 +1,5 @@ +{ +"foo": "A foo string", +"baz": 1, +"boo": false +} diff --git a/api-specs/test/examples/json-serializable-primitive-object.json b/api-specs/test/examples/json-serializable-primitive-object.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/api-specs/test/examples/json-serializable-primitive-object.json @@ -0,0 +1 @@ +{} diff --git a/api-specs/test/examples/json-serializable-primitive-raw.json b/api-specs/test/examples/json-serializable-primitive-raw.json new file mode 100644 index 000000000..d3e505fbc --- /dev/null +++ b/api-specs/test/examples/json-serializable-primitive-raw.json @@ -0,0 +1 @@ +"raw string" diff --git a/api-specs/test/examples/object-test-type-draft.json b/api-specs/test/examples/object-test-type-draft.json new file mode 100644 index 000000000..9485a4c24 --- /dev/null +++ b/api-specs/test/examples/object-test-type-draft.json @@ -0,0 +1,20 @@ +{ + "objectTypeProperty": { + "arrayOfIntExample": [1, 2, 1, 3, 2, 3, 1], + "arrayOfUniqueIntExample": [1, 3, 5, 7], + "arrayOfTwonumbersExample": [3, 5], + "arrayOfFloatExample": [0.82], + "arrayOfNumberNoDefaultsExample": [10, 9, 8, 7, 6], + "arrayOfStringExample": ["dog", "cat", "bird"], + "arrayOfObjectType": [ + { + "integerExample": 777, + "integerExampleInt32": 1 + }, + { + "integerExample": 30000, + "integerExampleInt32": 22 + } + ] + } +} diff --git a/api-specs/test/examples/object-test-type.json b/api-specs/test/examples/object-test-type.json new file mode 100644 index 000000000..eedbb9620 --- /dev/null +++ b/api-specs/test/examples/object-test-type.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "objectTypeProperty": { + "arrayOfIntExample": [2, 4, 2, 6, 4, 6, 2], + "arrayOfUniqueIntExample": [2, 6, 10, 14], + "arrayOfTwonumbersExample": [6, 10], + "arrayOfFloatExample": [1.64], + "arrayOfNumberNoDefaultsExample": [20, 18, 16, 14, 12], + "arrayOfStringExample": ["dogdog", "catcat", "birdbird"], + "arrayOfObjectType": [ + { + "integerExample": 1554, + "integerExampleInt32": 2 + }, + { + "integerExample": 60000, + "integerExampleInt32": 22 + } + ] + } +} diff --git a/api-specs/test/examples/out-of-order-properties-test-type.json b/api-specs/test/examples/out-of-order-properties-test-type.json new file mode 100644 index 000000000..dc918f7d6 --- /dev/null +++ b/api-specs/test/examples/out-of-order-properties-test-type.json @@ -0,0 +1,24 @@ +{ + "eigthProperty": "Should display 8th (1st in RAML)", + "createdBy": { + "firstName": "John", + "lastName": "Doe" + }, + "ninthProperty": "Should display 9th (3rd in RAML)", + "key": "Should display 3rd (4th in RAML)", + "tenthProperty": "Should display 10th (5th in RAML)", + "custom": "Should display 16th (6th in RAML)", + "eleventhPropery": "Should display 11th (7th in RAML)", + "id": "Should display 1st (8th in RAML)", + "twelthProperty": "Should display 12th (9th in RAML)", + "lastModifiedBy": { + "firstName": "Jane", + "lastName": "Doe" + }, + "thirteenthProperty": "Should display 13th (11th in RAML)", + "lastModifiedAt": "2016-02-28T16:41:41.090Z", + "fourteenthProperty": "Should display 14th (13th in RAML)", + "fifteenthProperty": "Should display 15th (14th in definition)", + "createdAt": "2015-02-28T16:41:41.090Z", + "version": "Should display 2nd (16th in RAML)" +} \ No newline at end of file diff --git a/api-specs/test/examples/product-example.json b/api-specs/test/examples/product-example.json new file mode 100644 index 000000000..d9dbf03ba --- /dev/null +++ b/api-specs/test/examples/product-example.json @@ -0,0 +1,106 @@ +{ + "id": "e7ba4c75-b1bb-483d-94d8-2c4a10f78472", + "version": 2, + "masterData": { + "current": { + "categories": [ + { + "id": "cf6d790a-f027-4f46-9a2b-4bc9a31066fb", + "typeId": "category" + } + ], + "description": { + "en": "Sample description" + }, + "masterVariant": { + "attributes": [], + "id": 1, + "images": [ + { + "dimensions": { + "h": 1400, + "w": 1400 + }, + "url": "https://commercetools.com/cli/data/253245821_1.jpg" + } + ], + "prices": [ + { + "value": { + "type": "centPrecision", + "fractionDigits": 2, + "centAmount": 10000, + "currencyCode": "EUR" + }, + "id": "753472a3-ddff-4e0f-a93b-2eb29c90ba54" + } + ], + "sku": "sku_MB_PREMIUM_TECH_T_variant1_1369226795424" + }, + "name": { + "en": "MB PREMIUM TECH T" + }, + "slug": { + "en": "mb-premium-tech-t1369226795424" + }, + "variants": [], + "searchKeywords": {} + }, + "hasStagedChanges": false, + "published": true, + "staged": { + "categories": [ + { + "id": "cf6d790a-f027-4f46-9a2b-4bc9a31066fb", + "typeId": "category" + } + ], + "description": { + "en": "Sample description" + }, + "masterVariant": { + "attributes": [], + "id": 1, + "images": [ + { + "dimensions": { + "h": 1400, + "w": 1400 + }, + "url": "https://commercetools.com/cli/data/253245821_1.jpg" + } + ], + "prices": [ + { + "value": { + "type": "centPrecision", + "fractionDigits": 2, + "centAmount": 10000, + "currencyCode": "EUR" + }, + "id": "753472a3-ddff-4e0f-a93b-2eb29c90ba54" + } + ], + "sku": "sku_MB_PREMIUM_TECH_T_variant1_1369226795424" + }, + "name": { + "en": "MB PREMIUM TECH T" + }, + "slug": { + "en": "mb-premium-tech-t1369226795424" + }, + "variants": [], + "searchKeywords": {} + } + }, + "productType": { + "id": "24f510c3-f334-4099-94e2-d6224a8eb919", + "typeId": "product-type" + }, + "taxCategory": { + "id": "f1e10e3a-45eb-49d8-ad0b-fdf984202f59", + "typeId": "tax-category" + }, + "createdAt": "1970-01-01T00:00:00.001Z", + "lastModifiedAt": "1970-01-01T00:00:00.001Z" +} diff --git a/api-specs/test/examples/string-test-type.json b/api-specs/test/examples/string-test-type.json new file mode 100644 index 000000000..b97401bed --- /dev/null +++ b/api-specs/test/examples/string-test-type.json @@ -0,0 +1,3 @@ +{ + "stringExample": "0123456" +} \ No newline at end of file diff --git a/api-specs/test/security-schemes/oauth2.raml b/api-specs/test/security-schemes/oauth2.raml new file mode 100644 index 000000000..3e3714fbb --- /dev/null +++ b/api-specs/test/security-schemes/oauth2.raml @@ -0,0 +1,23 @@ +#%RAML 1.0 SecurityScheme + +description: | + Subset of allowable CT OAuth scopes for testing purposes. +type: OAuth 2.0 +describedBy: + headers: + Authorization: + description: | + On successful completion of an authorization flow, + a client will be given an `access_token`, which they need to include in requests + to authorized service endpoints via the HTTP `Authorization` header like this: + Authorization: Bearer {access_token} + type: string + responses: + 401: + description: Unauthorized +settings: + accessTokenUri: https://subdomain-auth.example.com/oauth/{projectKey}/anonymous/token + authorizationGrants: [client_credentials, password] + scopes: + - 'manage_test:{projectKey}' + - 'view_test:{projectKey}' diff --git a/api-specs/test/types/annotations-test-type.raml b/api-specs/test/types/annotations-test-type.raml new file mode 100644 index 000000000..d25c561da --- /dev/null +++ b/api-specs/test/types/annotations-test-type.raml @@ -0,0 +1,21 @@ +#%RAML 1.0 Library +usage: Annotations test types. + +uses: + annotations: ../annotation-types/annotations.raml + +types: + AnnotationsTestType: + properties: + isBetaType: + description: Beta property. If true, a "beta" flag should appear beside the type name. + type: string + (annotations.beta): true + isOptionalBetaType?: + description: Beta property. If true, a "beta" flag should appear beside the type name. + type: string + (annotations.beta): true + isDeprecatedType: + description: Deprecated property. THIS MUST NOT BE RENDERED AT ALL (=hidden in documentation, it just stays there to keep SDKs backwards compatible). + type: string + (annotations.deprecated): true diff --git a/api-specs/test/types/any-properties-type.raml b/api-specs/test/types/any-properties-type.raml new file mode 100644 index 000000000..466a15a9b --- /dev/null +++ b/api-specs/test/types/any-properties-type.raml @@ -0,0 +1,10 @@ +#%RAML 1.0 Library +usage: Any properties test types. + +types: + AnyPropertiesType: + description: This is a type that can have arbitrary properties + type: object + properties: + //: + type: string diff --git a/api-specs/test/types/any-test-type.raml b/api-specs/test/types/any-test-type.raml new file mode 100644 index 000000000..8e3124fb7 --- /dev/null +++ b/api-specs/test/types/any-test-type.raml @@ -0,0 +1,10 @@ +#%RAML 1.0 Library +usage: Any test types. + +types: + AnyTestType: + description: Tests acceptance of JSON blobs. [Test Endpoint URN](ctp:test:endpoint:/{projectKey}/resource/{id}:POST) [Test Overridden Endpoint URN](ctp:test:endpoint:/{projectKey}/resource:GET) + properties: + anyTypeExample: + description: A test of type "any", i.e. any JSON allowed here. To be displayed as "any JSON". + type: any diff --git a/api-specs/test/types/arrays.raml b/api-specs/test/types/arrays.raml new file mode 100644 index 000000000..bdddbe0bd --- /dev/null +++ b/api-specs/test/types/arrays.raml @@ -0,0 +1,95 @@ +#%RAML 1.0 Library +usage: Array test types. + +uses: + scalars: scalars.raml + +types: + ArrayTestType: + description: A type containing arrays of different kinds. + properties: + arrayOfIntExample: + description: A property with an array of ints. JSON primitive is `array`, display type is "Array of Int". + type: integer[] + minItems: 1 + uniqueItems: false + arrayOfUniqueIntExample: + description: A property with an array of ints in which items must be unique. JSON primitive is `array`, display type is "Array of Int" + type: integer[] + minItems: 1 + uniqueItems: true + arrayOfTwonumbersExample: + type: integer[] + minItems: 2 + maxItems: 2 + arrayOfFloatExample: + description: An array of float. JSON primitive is `array`, display type is "Array of Float". !!! Until underlying libraries are fixed, this displays "Array of Number" because the pattern information is lost. + type: array + items: + type: number + format: 'float' + minItems: 1 + maxItems: 1 + uniqueItems: false + arrayOfNumberNoDefaultsExample: + description: An array of float. JSON primitive is `array`, display type is "Array of Number" + type: number[] + arrayOfStringExample: + description: An array of strings. JSON primitive is `array`, display type is "Array of String" + type: string[] + uniqueItems: false + arrayOfObjectType: + description: An array of IntegerTestType. JSON primitive is `array`, display type is "Array of IntegerTestType" + type: scalars.IntegerTestType[] + uniqueItems: false + example: !include ../examples/array-test-type.json + WideLayoutArrayTestType: + description: A copy of ArrayTestType, used to test wide layout. Very long text to test the description width. Very long text to test the description width. Very long text to test the description width. Very long text to test the description width. + properties: + arrayOfIntExample: + description: A property with an array of ints. JSON primitive is `array`, display type is "Array of Int". + type: integer[] + minItems: 1 + uniqueItems: false + arrayOfUniqueIntExample: + description: A property with an array of ints in which items must be unique. JSON primitive is `array`, display type is "Array of Int" + type: integer[] + minItems: 1 + uniqueItems: true + arrayOfTwonumbersExample: + type: integer[] + minItems: 2 + maxItems: 2 + arrayOfFloatExample: + description: An array of float. JSON primitive is `array`, display type is "Array of Float". !!! Until underlying libraries are fixed, this displays "Array of Number" because the pattern information is lost. + type: array + items: + type: number + format: 'float' + minItems: 1 + maxItems: 1 + uniqueItems: false + arrayOfNumberNoDefaultsExample: + description: An array of float. JSON primitive is `array`, display type is "Array of Number" + type: number[] + arrayOfStringExample: + description: An array of strings. JSON primitive is `array`, display type is "Array of String" + type: string[] + uniqueItems: false + arrayOfObjectType: + description: An array of IntegerTestType. JSON primitive is `array`, display type is "Array of IntegerTestType" + type: scalars.IntegerTestType[] + uniqueItems: false + example: !include ../examples/array-test-type.json + UnionReferenceTestType: + description: A test type with a reference with multiple type options. + type: object + properties: + reference: + type: ArrayTestType | WideLayoutArrayTestType + description: | + Reference description. + key?: + type: string + description: | + Key type description. diff --git a/api-specs/test/types/constants.raml b/api-specs/test/types/constants.raml new file mode 100644 index 000000000..7fab922e7 --- /dev/null +++ b/api-specs/test/types/constants.raml @@ -0,0 +1,27 @@ +#%RAML 1.0 Library +usage: Constant like test types. + +# Making constant values explicit is more usable so we render this pattern differnt than a regular Enum: + +types: + ConstantLikeType: + type: string + description: render an enum with one value as a constant. + enum: [constantExampleValue] + ConstantLikeProperties: + description: Has properties that are constant-like, that is, enums with only one value. + properties: + stringConstantLike: + description: a string contant-like property + type: string + enum: + - constantStringValue + intConstantLike: + description: an integer contant-like property + type: integer + enum: [256] + floatConstantLike: + description: a float contant-like property + type: number + format: float + enum: [3.14] diff --git a/api-specs/test/types/date-test-type.raml b/api-specs/test/types/date-test-type.raml new file mode 100644 index 000000000..aad9361f7 --- /dev/null +++ b/api-specs/test/types/date-test-type.raml @@ -0,0 +1,34 @@ +#%RAML 1.0 Library +usage: Date test types. + +types: + DateTestType: + description: Test data for the RAML date formats. + properties: + dateOnlyExample: + description: to be shown as "Date" + type: date-only + example: '2015-05-23' + timeOnlyExample: + description: to be shown as "Time" + type: time-only + example: '12:30:00' + dateTimeOnlyExample: + description: To be shown as "DateTimeOnly". We do not recommend this format. + type: datetime-only + example: '2015-07-04T21:00:00' + dateTimeExample: + description: rfc3339 format explicitly set. To be shown as "DateTime" + type: datetime + format: rfc3339 + example: '2016-02-28T16:41:41.090Z' + dateTimeExampleDefaultFormat: + description: format not set, rfc3339 is default, so this is also shown as "DateTime" + type: datetime + example: '2016-02-28T16:41:41.090Z' + dateTimeExampleRfc: + description: To be shown as "DateTimeRfc2616". Not a recommended format. + type: datetime + format: rfc2616 + example: 'Sun, 28 Feb 2016 16:41:41 GMT' + example: !include ../examples/date-test-type.json diff --git a/api-specs/test/types/descriptions-with-urn-links.raml b/api-specs/test/types/descriptions-with-urn-links.raml new file mode 100644 index 000000000..d09f66b0d --- /dev/null +++ b/api-specs/test/types/descriptions-with-urn-links.raml @@ -0,0 +1,12 @@ +#%RAML 1.0 Library +usage: Descriptions with URN links. + +types: + DescriptionsWithUrnLinks: + description: | + This link - [ObjectTestTypeDraft](ctp:test:type:ObjectTestTypeDraft), `[ObjectTestTypeDraft](ctp:test:type:ObjectTestTypeDraft)`, must be auto-generated. + properties: + version: + description: | + This link - [OutOfOrderPropertiesTestType](ctp:test:type:OutOfOrderPropertiesTestType), `[OutOfOrderPropertiesTestType](ctp:test:type:OutOfOrderPropertiesTestType)`, must be auto-generated. + type: integer diff --git a/api-specs/test/types/enums.raml b/api-specs/test/types/enums.raml new file mode 100644 index 000000000..3f8b7daf3 --- /dev/null +++ b/api-specs/test/types/enums.raml @@ -0,0 +1,112 @@ +#%RAML 1.0 Library +usage: Enum test types. + +uses: + annotations: ../annotation-types/annotations.raml + +types: + EnumTest: + description: Example enumeration for the SetOfEnumTestTypes type. + type: string + enum: + - EnumEntryOne + - EnumEntryTwo + - EnumEntryThree + - enum + (annotations.enumDescriptions): + EnumEntryOne: | + This is the first entry in the EnumTest enumeration. + EnumEntryTwo: | + This is the second entry in the EnumTest enumeration. + EnumEntryThree: | + This is the third entry in the EnumTest enumeration. + enum: | + This is an item called with a reserved word. + EnumPropertiesType: + description: Test data for properties with enums that are of differing primitive types + properties: + intWithEnumExample: + description: An int with enum values + type: integer + enum: [1, 2, 3] + floatWithEnumExample: + description: A float with enum values + type: number + format: float + default: 1.0 + enum: [1.0, 2.0, 3.0] + enumOfStringExample: + description: A string with enum values (undescribed) + type: string + enum: + - 'dog' + - 'cat' + - 'elephant' + default: 'dog' + SetOfEnumTestType: + description: A type containing a property with a set of Enums + # I.e. how `ChannelDraft` has `ChannelRole`s + properties: + setofEnumExample: + description: | + Contains a Set of `EnumTest`. If `uniqueItems` is `true` for an Array, + the then instead of "Array of ______", it needs to read "Set of _______". + type: EnumTest[] + uniqueItems: true + EnumWithDescriptionExample: + description: Enum with agreed upon description annotation. + type: string + (annotations.enumDescriptions): + enumValue1: description 1 + enumValue2: description 2 + enumValue3: description 3 + enumWithMarkdownDescription: | + `inline-code` should be formatted as an inline code. [ObjectTestType](/types/general#objecttesttype) should link to the header of the definition of `ObjectTestType` on this website - `api-docs-smoke-test`. [Links](/../docs-smoke-test/views/markdown#links) should link to the header for the definition of `Links` on `docs-smoke-test` microsite. + enum: + - enumValue1 + - enumValue2 + - enumValue3 + - enumWithoutDescription + - enumWithMarkdownDescription + EnumWithGroupsExample: + description: Enum with agreed upon description annotation. + type: string + (annotations.enumDescriptions): + enumValue1: description 1 + enumValue2: description 2 + enumValue3: description 3 + enumValue4: description 4 + enumValue5: description 5 + enumValue6: description 6 + enumValue7: description 7 + enumValue8: description 8 + enumValue9: description 9 + enumValue10: description 10 + enumWithMarkdownDescription: | + `inline-code` should be formatted as an inline code. [ObjectTestType](/types/general#objecttesttype) should link to the header of the definition of `ObjectTestType` on this website - `api-docs-smoke-test`. [Links](/../docs-smoke-test/views/markdown#links) should link to the header for the definition of `Links` on `docs-smoke-test` microsite. + enum: + - enumValue1 + - enumValue2 + - enumValue3 + - enumValue4 + - enumValue5 + - enumValue6 + - enumValue7 + - enumValue8 + - enumValue9 + - enumValue10 + - enumWithoutDescription + - enumWithMarkdownDescription + (annotations.enumGroups): + enumValue1: Group 3 + enumValue2: Group 1 + enumValue3: Group 2 + enumValue4: Group 3 + enumValue5: Group 2 + enumValue6: Group 2 + enumValue7: Group 1 + enumValue8: Group 3 + enumValue9: Group 2 + enumValue10: Group 2 + enumWithoutDescription: Group 2 + enumWithMarkdownDescription: Group 1 diff --git a/api-specs/test/types/examples.raml b/api-specs/test/types/examples.raml new file mode 100644 index 000000000..f9259d51e --- /dev/null +++ b/api-specs/test/types/examples.raml @@ -0,0 +1,114 @@ +#%RAML 1.0 Library +usage: Example test types. + +types: + ExamplesTestType: + properties: + foo: + type: string + baz: + type: integer + boo: + type: boolean + examples: + simpleExample: !include ../examples/example.json + fullExample: + displayName: Full Example + description: | + This **markdown** formatted description of the code example is to be shown with it. + The title of this example must be "Full Example" (displayName overrides the name). + The JSON contained must be code highlighted because the mime type is set. + value: !include ../examples/example.json + fullExampleWithLoosenedStrict: + displayName: Full Example with default strict setting + description: | + "strict" defaults to true, this is set to false and the example is wrong so it should parse + value: !include ../examples/example-nonconforming.json + strict: false + fullExampleInRamlNotation: + displayName: Example in RAML notation + description: | + We're not typically doing this but it should not fail. It places an object in RAML/YAML notation + in the tree. The parser's default output serializes it to JSON, which is another pointer that JSON _is_ the + default assumption. + value: + foo: bar + baz: 100 + boo: false + strict: true + + SingleExampleTestType: + properties: + foo: + type: string + baz: + type: integer + boo: + type: boolean + example: !include ../examples/example.json + + SingleFullExampleTestType: + properties: + foo: + type: string + baz: + type: integer + boo: + type: boolean + example: + displayName: Full Example + description: | + This **markdown** formatted description of the code example is to be shown with it. + The title of this example must be "Full Example" (displayName overrides the name). + The JSON contained must be code highlighted because the mime type is set. + value: !include ../examples/example.json + strict: false + + # Update / Update Actions related. + # The actual Update Action Types are postfixed with "OnFooBar" to namespace them across endpoints. + # All Update Actions for a given resource must inherit from a given parent type. + # The parent type must not inherit from further levels of abstract types. + # The Update Actions are modeled as a Union-Like pattern (see above) + ExampleResourceUpdate: + properties: + version: + type: number + description: | + The expected version of the ExampleResource on which the changes should be applied. + If the expected version does not match the actual version, a 409 Conflict will be returned. + actions: + type: array + items: ExampleResourceUpdateAction + description: | + The list of update actions to be performed on the ExampleResource. + Actions are applied in the given order. + example: !include ../examples/example-resource-update.json + + ExampleResourceUpdateAction: + discriminator: action + properties: + action: + type: string + + DoSomeThingOnExampleResource: + displayName: Do SomeThing + type: ExampleResourceUpdateAction + discriminatorValue: doSomeThing + example: !include ../examples/do-something-on-example-resource.json + + ChangeSomePropertyOnExampleResource: + type: ExampleResourceUpdateAction + displayName: Change SomeProperty + discriminatorValue: changeSomeProperty + properties: + someProperty: + type: string + + ImportFooForSecondPropertyToUpdateOnExampleResource: + type: ExampleResourceUpdateAction + description: Another Update action for ExampleResource that needs crazy long name + displayName: Import Foo for SecondPropertyToUpdate + discriminatorValue: importFooForSecondPropertyToUpdate + properties: + secondPropertyToUpdate: + type: string diff --git a/api-specs/test/types/link-test-types.raml b/api-specs/test/types/link-test-types.raml new file mode 100644 index 000000000..39f0debc1 --- /dev/null +++ b/api-specs/test/types/link-test-types.raml @@ -0,0 +1,23 @@ +#%RAML 1.0 Library +usage: External link test type. + +uses: + scalars: scalars.raml + overrides: type-overrides.raml + +types: + LinkToTypeOnSameSite: + properties: + LinkToTypeOnSameSite: + description: A link pointing to a type the same microsite. + type: scalars.StringTestType + LinkToTypeOnAnotherSite: + properties: + LinkToTypeOnAnotherSite: + description: A link pointing to a type in another microsite. + type: overrides.TestTypeOnAnotherMicrosite + LinkToTypeOnExternalSite: + properties: + LinkToTypeOnExternalSite: + description: A link pointing to a type in an external website. + type: overrides.TestTypeOnAnExternalWebsite diff --git a/api-specs/test/types/objects.raml b/api-specs/test/types/objects.raml new file mode 100644 index 000000000..b7262cf3b --- /dev/null +++ b/api-specs/test/types/objects.raml @@ -0,0 +1,21 @@ +#%RAML 1.0 Library +usage: Object test types. + +uses: + arrays: arrays.raml + +types: + ObjectTestType: + description: A typical Object type with a non-scalar property. + properties: + version: + type: integer + objectTypeProperty: + type: arrays.ArrayTestType + example: !include ../examples/object-test-type.json + ObjectTestTypeDraft: + description: A type to create an ObjectTestType. Used for testing the endpoint layout. + properties: + objectTypeProperty: + type: arrays.ArrayTestType + example: !include ../examples/object-test-type-draft.json diff --git a/api-specs/test/types/optional-property-test-type.raml b/api-specs/test/types/optional-property-test-type.raml new file mode 100644 index 000000000..3de95d940 --- /dev/null +++ b/api-specs/test/types/optional-property-test-type.raml @@ -0,0 +1,19 @@ +#%RAML 1.0 Library +usage: Optoinal property test types. + +# Tests "optional"/required fields + +types: + OptionalPropertyTestType: + description: Example of optional/non-optional properties. + properties: + requiredTrueExample: + type: string + description: this should be required. + required: true + requiredNotSetExample: + type: string + description: this should default to required = true. + requiredFalseExample: + type: string + required: false diff --git a/api-specs/test/types/out-of-order-properties-test-type.raml b/api-specs/test/types/out-of-order-properties-test-type.raml new file mode 100644 index 000000000..82ac8f3ea --- /dev/null +++ b/api-specs/test/types/out-of-order-properties-test-type.raml @@ -0,0 +1,67 @@ +#%RAML 1.0 Library +usage: Out of order properties test types. + +uses: + annotations: ../annotation-types/annotations.raml + +types: + OutOfOrderPropertiesTestType: + description: | + Tests out of order properties. By convention, `id`, `key`, `version`, `createdAt`, + `createdBy`, `lastModifiedAt` and `lastModifiedBy` should display at the top (in that order). + `custom` should display at the bottom. All other properties should render in the order they + appear. + Some types will not have all of the 'conventional' properties – i.e. cart doesn't have a key field. + In this case, ordering would go `id`, `version`... etc. + properties: + eigthProperty: + type: string + description: Should display 8th (1st in RAML) + createdBy: + type: object + (annotations.beta): true + description: Should display 5th (2nd in RAML) + ninthProperty: + type: string + description: Should display 9th (3rd in RAML) + key: + type: string + description: Should display 3rd (4th in RAML) + tenthProperty: + type: string + description: Should display 10th (5th in RAML) + custom: + type: string + description: Should display 16th (6th in RAML) + eleventhPropery: + type: string + description: Should display 11th (7th in RAML) + id: + type: string + description: Should display 1st (8th in RAML) + twelthProperty: + type: string + description: Should display 12th (9th in RAML) + lastModifiedBy: + type: object + (annotations.beta): true + description: Should display 7th (10th in RAML) + thirteenthProperty: + type: string + description: Should display 13th (11th in RAML) + lastModifiedAt: + type: datetime + description: Should display 6th (12th in RAML) + fourteenthProperty: + type: string + description: Should display 14th (13th in RAML) + fifteenthProperty: + type: string + description: Should display 15th (14th in definition) + createdAt: + type: datetime + description: Should display 4th (15th in RAML) + version: + type: string + description: Should display 2nd (16th in RAML) + example: !include ../examples/out-of-order-properties-test-type.json diff --git a/api-specs/test/types/references.raml b/api-specs/test/types/references.raml new file mode 100644 index 000000000..3ca95272b --- /dev/null +++ b/api-specs/test/types/references.raml @@ -0,0 +1,147 @@ +#%RAML 1.0 Library +usage: References test types. + +uses: + annotations: ../annotation-types/annotations.raml + scalars: scalars.raml + +types: + ExampleTargetType: + description: empty target object type, just here to be able to point to it. + + ReferenceTypeId: + description: | + The allowed typeIds of the referenced resource. + type: string + enum: + - example-target + - cart-discount + - category + - channel + - customer + - customer-group + - price + - product + - product-type + - product-variant + - shipping-method + - state + - tax-category + (annotations.enumDescriptions): + example-target: References an ExampleTargetType. + cart-discount: References a cart discount. + category: References a category. + channel: References a channel. + customer: References a customer. + customer-group: References a customer group. + price: References a price. + product: References a product. + product-type: References a product type. + product-variant: References a product variant. + shipping-method: References a shipping method. + state: References a state. + tax-category: References a tax-category. + + ResourceIdentifier: + type: object + discriminator: typeId + properties: + typeId: + type: ReferenceTypeId + required: false + id: + type: string + required: false + key: + type: string + required: false + + Reference: + type: object + discriminator: typeId + properties: + typeId: + type: ReferenceTypeId + id: + type: string + obj: + type: any + required: false + + KeyReference: + type: object + discriminator: typeId + properties: + typeId: + type: ReferenceTypeId + key: + type: string + + ExampleTargetTypeReference: + type: Reference + displayName: Reference + (annotations.refersTo): ExampleTargetType + discriminatorValue: example-target + properties: + obj: + type: scalars.IntegerTestType + + ExampleTargetTypeKeyReference: + type: KeyReference + displayName: KeyReference + (annotations.refersTo): ExampleTargetType + discriminatorValue: example-target + + ExampleTargetTypeResourceIdentifier: + type: ResourceIdentifier + displayName: ResourceIdentifier + (annotations.refersTo): ExampleTargetType + discriminatorValue: example-target + + # This pattern is needed for cases like the customerId on the Cart, which is a pointer to another resource, but in plain String id format. + # The refersTo Annotation allows to also render these kinds of links in a structured way. + ExampleTargetTypePointer: + displayName: String + type: string + (annotations.refersTo): ExampleTargetType + + # References: This is the actual Test Type to be rendered: + ReferencesTestType: + description: Example for various sorts of References + properties: + exampleTargetId: + type: ExampleTargetTypePointer + description: | + A kind of reference that is not an object but directly the ID. + To be rendered as "String, refers to ExampleTargetType" + with "ExampleTargetType" being a link. + exampleTarget: + type: ExampleTargetTypeReference + description: | + Type should be rendered as "Reference, refers to ExampleTargetType" + with "Reference" and the "ExampleTargetType" being links. + exampleTargets: + type: ExampleTargetTypeReference[] + description: | + Type should be rendered as "Array of References, refers to ExampleTargetType" + with "References" and "ExampleTargetType" being links. + exampleTargetIdentifier: + type: ExampleTargetTypeResourceIdentifier + description: | + Type should be rendered as "ResourceIdentifier, refers to ExampleTargetType" + with "ResourceIdentifier" and "ExampleTargetType" being links. + exampleTargetIdentifiers: + type: ExampleTargetTypeResourceIdentifier[] + description: | + Type should be rendered as "Array of ResourceIdentifiers, refers to ExampleTargetType" + with "ResourceIdentifiers" and "ExampleTargetType" being links. + exampleTargetByKey: + type: ExampleTargetTypeKeyReference + description: | + Type should be rendered as "KeyReference, refers to ExampleTargetType" + with "KeyReference" and "ExampleTargetType" being links. + exampleTargetsByKey: + type: ExampleTargetTypeKeyReference[] + description: | + Type should be rendered as "Array of KeyReferences, refers to ExampleTargetType" + with "KeyReferences" and "ExampleTargetType" being links. diff --git a/api-specs/test/types/regex-properties-type-array.raml b/api-specs/test/types/regex-properties-type-array.raml new file mode 100644 index 000000000..e11e21fb3 --- /dev/null +++ b/api-specs/test/types/regex-properties-type-array.raml @@ -0,0 +1,15 @@ +#%RAML 1.0 Library +usage: Regex properties test types. + +uses: + objects: objects.raml + +types: + RegexPropertiesTypeArray: + description: This is a type that can have arbitrary properties as long as they match a certain expression + type: object + properties: + /^[a-z]{2}(-[A-Z]{2})?$/: + description: Regular expression property with an array type. To be displayed as "Array of ObjectTestType". The Slashes should appear in blue. + type: array + items: objects.ObjectTestType diff --git a/api-specs/test/types/regex-properties-type-object.raml b/api-specs/test/types/regex-properties-type-object.raml new file mode 100644 index 000000000..48b8b4a07 --- /dev/null +++ b/api-specs/test/types/regex-properties-type-object.raml @@ -0,0 +1,14 @@ +#%RAML 1.0 Library +usage: Regex properties test types. + +uses: + objects: objects.raml + +types: + RegexPropertiesTypeObject: + description: This is a type that can have arbitrary properties as long as they match a certain expression + type: object + properties: + /^[a-z]{2}(-[A-Z]{2})?$/: + description: Regular expression property with an object type. To be displayed as "Any (type) property matching this regular expression". The Slashes should appear in blue. + type: objects.ObjectTestType diff --git a/api-specs/test/types/regex-properties-type-string.raml b/api-specs/test/types/regex-properties-type-string.raml new file mode 100644 index 000000000..ca4c6706f --- /dev/null +++ b/api-specs/test/types/regex-properties-type-string.raml @@ -0,0 +1,11 @@ +#%RAML 1.0 Library +usage: Regex properties test types. + +types: + RegexPropertiesTypeString: + description: This is a type that can have arbitrary properties as long as they match a certain expression + type: object + properties: + /^[a-z]{2}(-[A-Z]{2})?$/: + description: Regular expression property with a string type. To be displayed as "Any (type) property matching this regular expression". The Slashes should appear in blue. + type: string diff --git a/api-specs/test/types/scalars.raml b/api-specs/test/types/scalars.raml new file mode 100644 index 000000000..effa7248b --- /dev/null +++ b/api-specs/test/types/scalars.raml @@ -0,0 +1,66 @@ +#%RAML 1.0 Library +usage: Scalars test types. + +types: + IntegerTestType: + description: This is a type which contains test data for Integer properties. + properties: + integerExample: + required: true + type: integer + description: Description Text of that [integer value](http://google.com) including rendered **markdown**. + default: 1 + minimum: 0 + maximum: 64650 + integerExampleInt32: + type: number + format: int32 + description: Tests an int32. + FloatTestType: + description: This is a type which contains test data for Float properties. + properties: + floatExample: + required: true + type: number + # https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#number + format: float + description: _Description Text_ including rendered markdown. + default: 1.5 + minimum: 0.1 + maximum: 2.23 + WideLayoutFloatTestType: + description: A copy of FloatTestType, used to test wide layout. + properties: + floatExample: + required: true + type: number + # https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#number + format: float + description: _Description Text_ including rendered markdown. + default: 1.5 + minimum: 0.1 + maximum: 2.23 + NumberTestType: + description: Tests JSON type "number", + properties: + numberExample: + required: true + type: number + StringTestType: + description: This is a type which contains test data for string properties. + properties: + stringExample: + required: true + type: string + default: '0' + description: Description Text including rendered *markdown*. + minLength: 1 + maxLength: 70909 + pattern: '[0-9|-]+' + example: !include ../examples/string-test-type.json + BooleanTestType: + properties: + booleanExample: + type: boolean + description: Description text including rendered `markdown`. + default: true diff --git a/api-specs/test/types/soft-links.raml b/api-specs/test/types/soft-links.raml new file mode 100644 index 000000000..f511120bb --- /dev/null +++ b/api-specs/test/types/soft-links.raml @@ -0,0 +1,114 @@ +#%RAML 1.0 Library +usage: Soft link types. + +uses: + scalars: scalars.raml + annotations: ../annotation-types/annotations.raml + +types: + SoftLinkObject: + description: A typical Object type with a non-scalar property. + properties: + version: + type: integer + objectTypeProperty: + type: SoftLinkArray + example: !include ../examples/object-test-type.json + SoftLinkArray: + description: A type containing arrays of different kinds. + properties: + arrayOfIntExample: + description: A property with an array of ints. JSON primitive is `array`, display type is "Array of Int". + type: integer[] + minItems: 1 + uniqueItems: false + arrayOfUniqueIntExample: + description: A property with an array of ints in which items must be unique. JSON primitive is `array`, display type is "Array of Int" + type: integer[] + minItems: 1 + uniqueItems: true + arrayOfTwonumbersExample: + type: integer[] + minItems: 2 + maxItems: 2 + arrayOfFloatExample: + description: An array of float. JSON primitive is `array`, display type is "Array of Float". !!! Until underlying libraries are fixed, this displays "Array of Number" because the pattern information is lost. + type: array + items: + type: number + format: 'float' + minItems: 1 + maxItems: 1 + uniqueItems: false + arrayOfNumberNoDefaultsExample: + description: An array of float. JSON primitive is `array`, display type is "Array of Number" + type: number[] + arrayOfStringExample: + description: An array of strings. JSON primitive is `array`, display type is "Array of String" + type: string[] + uniqueItems: false + arrayOfObjectType: + description: An array of IntegerTestType. JSON primitive is `array`, display type is "Array of IntegerTestType" + type: scalars.IntegerTestType[] + uniqueItems: false + example: !include ../examples/array-test-type.json + SoftLinkOutOfOrderProperties: + description: | + Tests out of order properties. By convention, `id`, `key`, `version`, `createdAt`, + `createdBy`, `lastModifiedAt` and `lastModifiedBy` should display at the top (in that order). + `custom` should display at the bottom. All other properties should render in the order they + appear. + Some types will not have all of the 'conventional' properties – i.e. cart doesn't have a key field. + In this case, ordering would go `id`, `version`... etc. + properties: + eigthProperty: + type: string + description: Should display 8th (1st in RAML) + createdBy: + type: object + (annotations.beta): true + description: Should display 5th (2nd in RAML) + ninthProperty: + type: string + description: Should display 9th (3rd in RAML) + key: + type: string + description: Should display 3rd (4th in RAML) + tenthProperty: + type: string + description: Should display 10th (5th in RAML) + custom: + type: string + description: Should display 16th (6th in RAML) + eleventhPropery: + type: string + description: Should display 11th (7th in RAML) + id: + type: string + description: Should display 1st (8th in RAML) + twelthProperty: + type: string + description: Should display 12th (9th in RAML) + lastModifiedBy: + type: object + (annotations.beta): true + description: Should display 7th (10th in RAML) + thirteenthProperty: + type: string + description: Should display 13th (11th in RAML) + lastModifiedAt: + type: datetime + description: Should display 6th (12th in RAML) + fourteenthProperty: + type: string + description: Should display 14th (13th in RAML) + fifteenthProperty: + type: string + description: Should display 15th (14th in definition) + createdAt: + type: datetime + description: Should display 4th (15th in RAML) + version: + type: string + description: Should display 2nd (16th in RAML) + example: !include ../examples/out-of-order-properties-test-type.json diff --git a/api-specs/test/types/type-overrides.raml b/api-specs/test/types/type-overrides.raml new file mode 100644 index 000000000..1421d2d8e --- /dev/null +++ b/api-specs/test/types/type-overrides.raml @@ -0,0 +1,14 @@ +#%RAML 1.0 Library +usage: External link test type. + +types: + TestTypeOnAnotherMicrosite: + properties: + TestTypeOnAnotherMicrosite: + description: A type in another microsite. + type: TestTypeOnAnotherMicrosite + TestTypeOnAnExternalWebsite: + properties: + TestTypeOnAnExternalWebsite: + description: A type in an external website. + type: TestTypeOnAnExternalWebsite diff --git a/api-specs/test/types/unions.raml b/api-specs/test/types/unions.raml new file mode 100644 index 000000000..5e713c6dc --- /dev/null +++ b/api-specs/test/types/unions.raml @@ -0,0 +1,59 @@ +#%RAML 1.0 Library +usage: Unions test types. + +# Not supporting actual RAML Union types, only a pattern that has a parent without own properties except the discriminator + +uses: + enums: enums.raml + +types: + UnionLike: + description: | + A pattern of inheritance that is to be represented like a union, i.e. this parent type would not be shown with a property list on its own. + type: object + discriminator: kind + properties: + kind: string + nonDiscriminatorProperty: string + UnionLikeSubType1: + description: This specific instance of the union is rendered like a regular type with a property table + type: UnionLike + discriminatorValue: subtype1 + properties: + foo: string + name: string + UnionLikeSubType2: + description: This specific instance of the union is rendered like a regular type with a property table + type: UnionLike + discriminatorValue: subtype2 + properties: + bar: string + name: string + UnionLikeWithEnumDescriptionPropertiesInSubtype: + description: | + This pattern has sub-types whose properties are enumerations with descriptions. + type: object + discriminator: type + properties: + type: enums.EnumWithDescriptionExample + UnionLikeSubTypeWithEnumDescriptionProperties1: + description: The discriminatorValue (value1) of this union like sub stype is defined in EnumWithDescriptionExample + type: UnionLikeWithEnumDescriptionPropertiesInSubtype + discriminatorValue: enumValue1 + properties: + foo: string + name: string + UnionLikeSubTypeWithEnumDescriptionProperties2: + description: The discriminatorValue (value2) of this union like sub stype is defined in EnumWithDescriptionExample + type: UnionLikeWithEnumDescriptionPropertiesInSubtype + discriminatorValue: enumValue2 + properties: + bar: string + name: string + UnionLikeSubTypeWithEnumDescriptionProperties3: + description: The discriminatorValue (value2) of this union like sub stype is defined in EnumWithDescriptionExample but without a description. + type: UnionLikeWithEnumDescriptionPropertiesInSubtype + discriminatorValue: enumWithoutDescription + properties: + baz: string + name: string