express-openapi-validator icon indicating copy to clipboard operation
express-openapi-validator copied to clipboard

Support readOnly + required combination again

Open FYamazaki opened this issue 9 months ago • 3 comments

I am totally new here. But I found a similar issue at [Support readOnly + required combination|https://github.com/cdimascio/express-openapi-validator/issues/145] The 4.13.9 has the same issue.

FYamazaki avatar Jun 10 '25 16:06 FYamazaki

there is a test for this that is passing.

test: https://github.com/cdimascio/express-openapi-validator/blob/master/test/read.only.spec.ts#L170-L184 oas spec: https://github.com/cdimascio/express-openapi-validator/blob/master/test/resources/read.only.yaml#L14-L46

please validate your spec/usage against this to ensure its accurate

cdimascio avatar Jun 14 '25 13:06 cdimascio

I tried to clone, build, and test. But I couldn't build it. But any test case for both default and readOnly like this? {code} nfProfileChangesInd: type: boolean default: false readOnly: true {code}

FYamazaki avatar Jun 17 '25 16:06 FYamazaki

@FYamazaki to get set up quickly, click the "Gitpod | Ready-to-code" badge.

Image

Step by Step:

  1. Navigate to https://github.com/cdimascio/express-openapi-validator
  2. Click the "Gitpod | Ready-to-code" badge
  3. Login to Gitpod using your e.g. Github account (You get 10 hours free per month)
  4. This will bring you into a brief setup wizard... Choose VsCode as the IDE and express-openapi-validator as the project

Once complete, you'll have a dev environment setup in the cloud for express-openapi-validator

  1. In the terminal, type
npm i && npm run compile && npm test

All the tests should pass.

You can now add it.only(... to the test in the comment above and poke around with the api spec.

cdimascio avatar Jun 20 '25 00:06 cdimascio