We can add custom tags to generated OPS

This commit is contained in:
Vincent Maillol
2021-08-22 14:32:19 +02:00
parent cb996860a9
commit fa7e8d914b
9 changed files with 173 additions and 40 deletions

View File

@@ -119,6 +119,24 @@ def test_paths_operation_requestBody():
}
def test_paths_operation_tags():
oas = OpenApiSpec3()
operation = oas.paths["/users/{petId}"].get
assert operation.tags == []
operation.tags = ['pets']
assert oas.spec['paths']['/users/{petId}'] == {
'get': {
'tags': ['pets']
}
}
operation.tags = []
assert oas.spec['paths']['/users/{petId}'] == {
'get': {}
}
def test_paths_operation_responses():
oas = OpenApiSpec3()
response = oas.paths["/users/{petId}"].get.responses[200]