Skip to content

Commit 4098170

Browse files
authored
Merge pull request #285 from python-openapi/feature/read-only-write-only-spec-test
Read-only write-only spec test
2 parents 96e094e + 0d70bcb commit 4098170

File tree

3 files changed

+50
-7
lines changed

3 files changed

+50
-7
lines changed

poetry.lock

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
openapi: "3.0.0"
2+
info:
3+
title: Specification Containing readOnly
4+
version: "0.1"
5+
paths:
6+
/users:
7+
post:
8+
operationId: createUser
9+
requestBody:
10+
description: Post data for creating a user
11+
required: true
12+
content:
13+
application/json:
14+
schema:
15+
$ref: '#/components/schemas/User'
16+
responses:
17+
default:
18+
description: Create a user
19+
content:
20+
application/json:
21+
schema:
22+
$ref: '#/components/schemas/User'
23+
components:
24+
schemas:
25+
User:
26+
x-model: User
27+
type: object
28+
required:
29+
- id
30+
- name
31+
properties:
32+
id:
33+
type: integer
34+
format: int32
35+
readOnly: true
36+
default: 1
37+
name:
38+
type: string
39+
hidden:
40+
type: boolean
41+
writeOnly: true
42+
default: true

tests/integration/validation/test_validators.py

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def local_test_suite_file_path(self, test_file):
6565
"petstore-separate/spec/openapi.yaml",
6666
"parent-reference/openapi.yaml",
6767
"property-recursive.yaml",
68+
"read-only-write-only.yaml",
6869
],
6970
)
7071
def test_valid(self, factory, validator_v30, spec_file):

0 commit comments

Comments
 (0)