We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openapi: '3.0.0' info: version: 1.0.0 title: example license: name: MIT paths: /weight-measures: post: tags: ['BeneficiaryMeasures'] operationId: createMeasureOfWeight summary: Record a weight measurement for the beneficiary. description: |- Save the weight with the author and datetime for the beneficiary identified by the ref. x-with-target-resource: true requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/V2MeasureOfWeightRequest' responses: '201': description: The new measure has been recorded. content: application/json: schema: $ref: '#/components/schemas/V2MeasureOfWeight' headers: Location: schema: type: string description: Relative URL to access this measure. components: schemas: V2AbstractMeasureRequest: type: object properties: effectiveDateTime: type: string format: date-time example: '2020-04-25T23:40:50.52Z' V2MeasureOfWeightRequest: allOf: - $ref: '#/components/schemas/V2AbstractMeasureRequest' - type: object required: - value properties: value: type: object required: - weight properties: weight: type: number format: double example: 83.5 minimum: 2.4 maximum: 500 V2MeasureOfWeight: allOf: - $ref: '#/components/schemas/MeasureHref' - type: object required: - effectiveDateTime - value properties: effectiveDateTime: type: string format: date-time example: '2020-04-25T23:40:50.52Z' value: $ref: '#/components/schemas/MeasureOfWeight' MeasureOfWeight: type: object allOf: - $ref: '#/components/schemas/MeasureValue' - type: object required: - weight properties: weight: type: number format: double example: 83.5 minimum: 2.4 maximum: 500 MeasureValue: type: object discriminator: propertyName: measureType mapping: Weight: '#/components/schemas/MeasureOfWeight' required: - measureType properties: measureType: $ref: '#/components/schemas/MeasureValueType' MeasureValueType: type: string enum: - Weight MeasureHref: type: object required: ['href'] properties: href: type: string x-data-type: MeasureHrefValue example: '/v1/measures/f2584c95-7df7-4f02-8181-8d0f3547cb87'
I received this error Parsing error: Property assignment expected for some of my .msw files.
Parsing error: Property assignment expected
.msw
export const getCreateMeasureOfWeightResponseMock = (): V2MeasureOfWeight => ( { href: faker.string.alpha(20), effectiveDateTime: `${faker.date.past().toISOString().split('.')[0]}Z`, value: {,weight: faker.number.float(),measureType: faker.helpers.arrayElement(['Weight'] as const)} } )
The comma , before weight needs to be removed.
,
export const getCreateMeasureOfWeightResponseMock = (): V2MeasureOfWeight => ( { href: faker.string.alpha(20), effectiveDateTime: `${faker.date.past().toISOString().split('.')[0]}Z`, value: {weight: faker.number.float(),measureType: faker.helpers.arrayElement(['Weight'] as const)} } )
This YAML reproduction worked fine with orval 6.25.0.
System: OS: macOS 15.1 CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 148.96 MB / 16.00 GB Shell: 5.9 - /bin/zsh npmPackages: axios: 1.7.9 => 1.7.9 msw: 2.7.0 => 2.7.0 orval: 7.3.0 => 7.3.0 react: 18.2.0 => 18.2.0
The text was updated successfully, but these errors were encountered:
I also tried to update orval to 6.31.0 (from 6.25.0) and I have the same problem with this version.
Sorry, something went wrong.
PR is welcome if you want to investigate!
The bug was introduce in the version 6.29.0 of orval.
Before that version, orval generate this:
export const getCreateMeasureOfWeightResponseMock = ( overrideResponse: any = {} ): V2MeasureOfWeight => ({ href: faker.word.sample(), ...overrideResponse, effectiveDateTime: `${faker.date.past().toISOString().split('.')[0]}Z`, value: { ...overrideResponse, weight: faker.number.int({ max: 500, min: 2.4 }), ...overrideResponse, measureType: faker.helpers.arrayElement(['Weight'] as const), ...overrideResponse, }, ...overrideResponse, });
With version 6.29.0 and up I have:
The bug was maybe introduced by this PR: #1338
ahhh nice. If you can make a fix that would be great!
Successfully merging a pull request may close this issue.
What are the steps to reproduce this issue?
YAML reproduction
What happens?
I received this error
Parsing error: Property assignment expected
for some of my.msw
files.What were you expecting to happen?
The comma
,
before weight needs to be removed.Other comments
This YAML reproduction worked fine with orval 6.25.0.
What versions are you using?
The text was updated successfully, but these errors were encountered: