Skip to content

Commit

Permalink
fix(msw): handle integer enums correctly (#1816)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllieJonsson authored Jan 16, 2025
1 parent dbd9c9b commit e47c3de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/mock/src/faker/getters/scalar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export const getMockScalar = ({
}
return {
value,
enums: item.enum,
imports: numberImports,
name: item.name,
};
Expand Down
9 changes: 9 additions & 0 deletions tests/specifications/enums.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ components:
Dog:
type: object
properties:
group:
$ref: '#/components/schemas/DogGroup'
petsRequested:
type: array
items:
Expand All @@ -132,3 +134,10 @@ components:
type: array
items:
type: string
DogGroup:
enum:
- 1
- 2
- 3
type: integer
format: int32

0 comments on commit e47c3de

Please sign in to comment.