Skip to content

Add header matching to API groups #449

Closed
@jacob-swanson

Description

@jacob-swanson

Is your feature request related to a problem? Please describe.
I am using an HTTP header for versioning my API. I want to create separate groups for each version of the API that I support.

Describe the solution you'd like
In addition to packages and paths, I would like to specify header values as well when creating an API group.

Something like this:

@Bean
public GroupedOpenApi v1Api() {
       Map<String,List<String>> headers = Map.of(
           "X-Api-Version", List.of("1.*")
       );
	return GroupedOpenApi.builder().setGroup("stores").headersToMatch(headers)
			.build();
}

Describe alternatives you've considered
None so far

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions