mirror of
https://github.com/correl/openapi-core.git
synced 2024-11-22 03:00:10 +00:00
Populate operation_id attr
This commit is contained in:
parent
11f0233ef2
commit
8ab0b6206e
2 changed files with 3 additions and 0 deletions
|
@ -31,6 +31,7 @@ class OperationsGenerator(object):
|
|||
parameters_list = operation_deref.get('parameters', [])
|
||||
parameters = self.parameters_generator.generate_from_list(
|
||||
parameters_list)
|
||||
operation_id = operation_deref.get('operationId')
|
||||
|
||||
request_body = None
|
||||
if 'requestBody' in operation_deref:
|
||||
|
@ -43,6 +44,7 @@ class OperationsGenerator(object):
|
|||
Operation(
|
||||
http_method, path_name, responses, list(parameters),
|
||||
request_body=request_body, deprecated=deprecated,
|
||||
operation_id=operation_id,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@ class TestPetstore(object):
|
|||
assert type(operation) == Operation
|
||||
assert operation.path_name == path_name
|
||||
assert operation.http_method == http_method
|
||||
assert operation.operation_id is not None
|
||||
|
||||
operation_spec = spec_dict['paths'][path_name][http_method]
|
||||
|
||||
|
|
Loading…
Reference in a new issue