Populate operation_id attr

This commit is contained in:
Rafael Caricio 2018-07-23 18:02:51 +02:00
parent 11f0233ef2
commit 8ab0b6206e
2 changed files with 3 additions and 0 deletions

View file

@ -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,
),
)

View file

@ -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]