From 73522479067f342f112549bc2c44553e8c633cfe Mon Sep 17 00:00:00 2001 From: almaraubel Date: Mon, 23 Sep 2024 20:19:12 +0200 Subject: [PATCH 1/2] fix: convert name in schema to pascal casing. This was already done in the core package but was not done during the generation of the MSW defintions. --- packages/mock/src/faker/resolvers/value.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mock/src/faker/resolvers/value.ts b/packages/mock/src/faker/resolvers/value.ts index 98399e906..08380fa9e 100644 --- a/packages/mock/src/faker/resolvers/value.ts +++ b/packages/mock/src/faker/resolvers/value.ts @@ -89,7 +89,7 @@ export const resolveMockValue = ({ const newSchema = { ...schemaRef, - name: originalName, + name: pascal(originalName), path: schema.path, isRef: true, }; From f174a4b8fbbb1ef7d7cf502efb7de1bc139a41c1 Mon Sep 17 00:00:00 2001 From: almaraubel Date: Mon, 23 Sep 2024 20:20:02 +0200 Subject: [PATCH 2/2] feat: Add status enum to pet schema Added a new enumeration `Domain.Status.Enum` to represent the status of pets with values. This enum I used to test if the MSW definitions where generated correct. --- samples/vue-query/vue-query-basic/petstore.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/samples/vue-query/vue-query-basic/petstore.yaml b/samples/vue-query/vue-query-basic/petstore.yaml index 5ea82d64f..a9d42c3b1 100644 --- a/samples/vue-query/vue-query-basic/petstore.yaml +++ b/samples/vue-query/vue-query-basic/petstore.yaml @@ -116,6 +116,12 @@ paths: description: Success components: schemas: + Domain.Status.Enum: + type: string + enum: + - new + - sold + - uknown Pet: type: object required: @@ -129,6 +135,8 @@ components: type: string tag: type: string + status: + $ref: '#/components/schemas/Domain.Status.Enum' email: type: string format: email