Skip to content

Commit 5ffcc6a

Browse files
authored
Merge pull request #62 from rafaelcaricio/populate-operation-id
Populate operation_id attribute
2 parents 11f0233 + 8ab0b62 commit 5ffcc6a

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

openapi_core/schema/operations/generators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def generate(self, path_name, path):
3131
parameters_list = operation_deref.get('parameters', [])
3232
parameters = self.parameters_generator.generate_from_list(
3333
parameters_list)
34+
operation_id = operation_deref.get('operationId')
3435

3536
request_body = None
3637
if 'requestBody' in operation_deref:
@@ -43,6 +44,7 @@ def generate(self, path_name, path):
4344
Operation(
4445
http_method, path_name, responses, list(parameters),
4546
request_body=request_body, deprecated=deprecated,
47+
operation_id=operation_id,
4648
),
4749
)
4850

tests/integration/test_petstore.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def test_spec(self, spec, spec_dict):
7474
assert type(operation) == Operation
7575
assert operation.path_name == path_name
7676
assert operation.http_method == http_method
77+
assert operation.operation_id is not None
7778

7879
operation_spec = spec_dict['paths'][path_name][http_method]
7980

0 commit comments

Comments
 (0)