Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Add predefined operationId support. #233

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tibortakacs
Copy link

If the operation described in the XML file has an tag, it
is used, otherwise (keeping the original behaviour) the id is generated
using the path () and the operation type ().

In order to do this, the following changes have been introduced:

  • Add UsePredefinedOperationIdFilter class which creates operations using
    tag.

  • Add CreateOperationMetaFilter which executes a list of operation creation
    filters. The first successful filter is used to generate the operations.
    This mechanism is used to support both the predefined and the generated
    operation id: first, the predefined operation id based filter is used, and
    if it fails, the operation id generation based filter is executed.

  • Add ICreateOperationPreprocessingOperationFilter to support applicable
    check in operation create filters in a general way.

  • Extend OperationHandler with GetOperationId function.

  • Slight refactor.

  • Small fix in GetUrl function.

  • Add extensive unit tests

  • Remove duplicated code from BranchOptionalPathParametersFilter and use
    OperationHandler existing functionality.

Tibor Takacs added 3 commits April 23, 2020 16:09
If the operation described in the XML file has an <operationId> tag, it
is used, otherwise (keeping the original behaviour) the id is generated
using the path (<url>) and the operation type (<verb>).

In order to do this, the following changes have been introduced:
+ Add UsePredefinedOperationIdFilter class which creates operations using
<operationId> tag.

+ Add CreateOperationMetaFilter which executes a list of operation creation
filters. The first successful filter is used to generate the operations.
This mechanism is used to support both the predefined and the generated
operation id: first, the predefined operation id based filter is used, and
if it fails, the operation id generation based filter is executed.

+ Add ICreateOperationPreprocessingOperationFilter to support applicable
check in operation create filters in a general way.

+ Extend OperationHandler with GetOperationId function.
+ Slight refactor.
+ Small fix in GetUrl function.
+ Add extensive unit tests

+ Remove duplicated code from BranchOptionalPathParametersFilter and use
OperationHandler existing functionality.
@tonymadkins
Copy link

This would be very useful for the MCAPI Fulfillment team! We are generating our OpenAPI spec with this package and found the operationId tag is consumed directly by the Geneva Actions extension when onboarding with their portal, so we could really use a customizable operationId tag to provide a more readable extension for our APIs.

Copy link
Member

@Shwetap05 Shwetap05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

Copy link
Member

@Shwetap05 Shwetap05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants