mirror of
https://github.com/correl/openapi-core.git
synced 2024-11-22 19:18:36 +00:00
Merge pull request #62 from rafaelcaricio/populate-operation-id
Populate operation_id attribute
This commit is contained in:
commit
5ffcc6af3f
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