diff --git a/src/scripts/import-open-api.ts b/src/scripts/import-open-api.ts index f34cb3f6..6d88ce45 100644 --- a/src/scripts/import-open-api.ts +++ b/src/scripts/import-open-api.ts @@ -375,7 +375,7 @@ export const generateRestfulComponent = ( const lastParamInTheRouteType = !isReference(lastParamInTheRouteDefinition.schema) && lastParamInTheRouteDefinition.schema - ? lastParamInTheRouteDefinition.schema.type + ? getScalar(lastParamInTheRouteDefinition.schema) : isReference(lastParamInTheRouteDefinition.schema) ? getRef(lastParamInTheRouteDefinition.schema.$ref) : "string"; diff --git a/src/scripts/tests/__snapshots__/import-open-api.test.ts.snap b/src/scripts/tests/__snapshots__/import-open-api.test.ts.snap index 44c80233..45948486 100644 --- a/src/scripts/tests/__snapshots__/import-open-api.test.ts.snap +++ b/src/scripts/tests/__snapshots__/import-open-api.test.ts.snap @@ -141,25 +141,25 @@ export type UseFindPetByIdProps = Omit, \\"path\\"> & {id export const useFindPetById = ({id, ...props}: UseFindPetByIdProps) => useGet(\`/pets/\${id}\`, props); -export type DeletePetProps = Omit, \\"path\\" | \\"verb\\">; +export type DeletePetProps = Omit, \\"path\\" | \\"verb\\">; /** * deletes a single pet based on the ID supplied */ export const DeletePet = (props: DeletePetProps) => ( - + verb=\\"DELETE\\" path={\`/pets\`} {...props} /> ); -export type UseDeletePetProps = Omit, \\"path\\" | \\"verb\\">; +export type UseDeletePetProps = Omit, \\"path\\" | \\"verb\\">; /** * deletes a single pet based on the ID supplied */ -export const useDeletePet = (props: UseDeletePetProps) => useMutate(\\"DELETE\\", \`/pets\`, props); +export const useDeletePet = (props: UseDeletePetProps) => useMutate(\\"DELETE\\", \`/pets\`, props); export type UpdatePetProps = Omit, \\"path\\" | \\"verb\\"> & {id: number}; diff --git a/src/scripts/tests/import-open-api.test.ts b/src/scripts/tests/import-open-api.test.ts index 51888eac..dc34b922 100644 --- a/src/scripts/tests/import-open-api.test.ts +++ b/src/scripts/tests/import-open-api.test.ts @@ -1774,7 +1774,7 @@ describe("scripts/import-open-api", () => { in: "path", required: true, description: "The id of the use case", - schema: { type: "number", format: "uuid" }, + schema: { type: "integer", format: "uuid" }, }, ], responses: {