Skip to content

Read-only write-only spec test #285

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

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions tests/integration/data/v3.0/read-only-write-only.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
openapi: "3.0.0"
info:
title: Specification Containing readOnly
version: "0.1"
paths:
/users:
post:
operationId: createUser
requestBody:
description: Post data for creating a user
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/User'
responses:
default:
description: Create a user
content:
application/json:
schema:
$ref: '#/components/schemas/User'
components:
schemas:
User:
x-model: User
type: object
required:
- id
- name
properties:
id:
type: integer
format: int32
readOnly: true
default: 1
name:
type: string
hidden:
type: boolean
writeOnly: true
default: true
1 change: 1 addition & 0 deletions tests/integration/validation/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def local_test_suite_file_path(self, test_file):
"petstore-separate/spec/openapi.yaml",
"parent-reference/openapi.yaml",
"property-recursive.yaml",
"read-only-write-only.yaml",
],
)
def test_valid(self, factory, validator_v30, spec_file):
Expand Down