Skip to content
New issue

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

Are readOnly and writeOnly properties supported? #35

Open
lavoscore opened this issue Nov 19, 2024 · 0 comments
Open

Are readOnly and writeOnly properties supported? #35

lavoscore opened this issue Nov 19, 2024 · 0 comments

Comments

@lavoscore
Copy link

After adding a writeOnly or readOnly property to my schema, my RSpec test fails with the following error:

"The object requires the following keys: username, password. Missing keys: password"

But password is marked as writeOnly and therefore should be ignored as per the OpenAPI docs:

If a readOnly or writeOnly property is included in the required list, required affects just the relevant scope – responses only or requests only. That is, read-only required properties apply to responses only, and write-only required properties – to requests only.

Schema:

type: object
properties:
  id:
    # Returned by GET, not used in POST/PUT/PATCH
    type: integer
    readOnly: true
  username:
    type: string
  password:
    # Used in POST/PUT/PATCH, not returned by GET
    type: string
    writeOnly: true
required:
  - username
  - password

Are readOnly and writeOnly properties taken into account by conform_schema?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant