Merge pull request #62 from rafaelcaricio/populate-operation-id

Populate operation_id attribute
This commit is contained in:
A 2018-07-23 19:42:12 +01:00 committed by GitHub
commit 5ffcc6af3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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]