Skip to content

Add OpenAPI Links support (#615)#1014

Open
kingdomOfIT wants to merge 1 commit intomarshmallow-code:devfrom
kingdomOfIT:feature/openapi-links
Open

Add OpenAPI Links support (#615)#1014
kingdomOfIT wants to merge 1 commit intomarshmallow-code:devfrom
kingdomOfIT:feature/openapi-links

Conversation

@kingdomOfIT
Copy link

Closes #615

Adds support for defining OpenAPI Links on path operations via the links
kwarg on APISpec.path(), as discussed in the issue with @zedrdave.

Links accept a dictionary of tuples in the format agreed with @lafrech:

links={
"GetUser": ("/users/{user_id}", "GET"),
"UpdateUser": ("/users/{user_id}", "PUT"),
"GetUserCustomParam": ("/users/{user_id}", "GET", {"user_id": "$response.body#/id"})
}

Implementation automatically uses operationId when the target operation
has one registered, falling back to operationRef with JSON Pointer escaping
when not. Links are only processed for OpenAPI 3+.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for OpenAPI Links?

2 participants

Comments