use of io.swagger.v3.oas.models.parameters.HeaderParameter in project syncope by apache.
the class SyncopeOpenApiCustomizer method addParameters.
@Override
protected void addParameters(final List<Parameter> parameters) {
if (domains == null) {
domains = new ArrayList<>(ApplicationContextProvider.getApplicationContext().getBean(DomainsHolder.class).getDomains().keySet());
}
Optional<Parameter> domainHeaderParameter = parameters.stream().filter(parameter -> parameter instanceof HeaderParameter && RESTHeaders.DOMAIN.equals(parameter.getName())).findFirst();
if (!domainHeaderParameter.isPresent()) {
HeaderParameter parameter = new HeaderParameter();
parameter.setName(RESTHeaders.DOMAIN);
parameter.setRequired(true);
Schema<String> schema = new Schema<>();
schema.setType("string");
schema.setEnum(domains);
schema.setDefault(SyncopeConstants.MASTER_DOMAIN);
parameter.setSchema(schema);
parameters.add(parameter);
}
}
Aggregations