diff --git a/packages/openapi-ts/test/spec/v3-transforms.json b/packages/openapi-ts/test/spec/v3-transforms.json index f9b45e02d..f168858e8 100644 --- a/packages/openapi-ts/test/spec/v3-transforms.json +++ b/packages/openapi-ts/test/spec/v3-transforms.json @@ -10,17 +10,75 @@ } ], "paths": { - "/api/v{api-version}/model-with-date/{id}": { + "/api/model-with-dates": { "put": { - "tags": ["Complex"], - "operationId": "ComplexParams", + "operationId": "modelWithDates", "responses": { "200": { "description": "Success", "content": { "application/json; type=collection": { "schema": { - "$ref": "#/components/schemas/ModelWithPattern" + "$ref": "#/components/schemas/ModelWithDates" + } + } + } + } + } + } + }, + "/api/model-with-dates-array": { + "put": { + "operationId": "modelWithDatesArray", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json; type=collection": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModelWithDates" + } + } + } + } + } + } + } + }, + "/api/array-of-dates": { + "put": { + "operationId": "arrayOfDates", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json; type=collection": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "date-time" + } + } + } + } + } + } + } + }, + "/api/date": { + "put": { + "operationId": "date", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json; type=collection": { + "schema": { + "type": "string", + "format": "date-time" } } } @@ -31,15 +89,13 @@ }, "components": { "schemas": { - "ModelWithPattern": { - "description": "This is a model that contains a some patterns", + "ModelWithDates": { + "description": "This is a model that contains a some dates", "type": "object", - "required": ["key", "name"], + "required": ["id", "name", "enabled"], "properties": { - "key": { - "maxLength": 64, - "pattern": "^[a-zA-Z0-9_]*$", - "type": "string" + "id": { + "type": "number" }, "name": { "maxLength": 255, @@ -54,25 +110,31 @@ "format": "date-time", "readOnly": true }, - "id": { - "type": "string", - "pattern": "^\\d{2}-\\d{3}-\\d{4}$" - }, - "text": { - "type": "string", - "pattern": "^\\w+$" - }, - "patternWithSingleQuotes": { + "expires": { "type": "string", - "pattern": "^[a-zA-Z0-9']*$" + "format": "date", + "readOnly": true + } + } + }, + "ParentModelWithDates": { + "description": "This is a model that contains a some dates and arrays", + "type": "object", + "required": ["id", "name"], + "properties": { + "id": { + "type": "number" }, - "patternWithNewline": { + "modified": { "type": "string", - "pattern": "aaa\nbbb" + "format": "date-time", + "readOnly": true }, - "patternWithBacktick": { - "type": "string", - "pattern": "aaa`bbb" + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModelWithDates" + } } } }