How to set the clientId and the clientSecret for displaying automatically on Authorization page?
On my Spring Boot application, I am trying to replace Swagger 2 with OpenApi 3. In the current implementation of SwaggerConfiguration class, @Configuration @EnableSwagger2 public class SwaggerConfig { ... @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.any()) .paths(PathSelectors.any()) .build() .securitySchemes(Collections.singletonList(securityScheme())) .host(host) .securityContexts(Collections.singletonList(securityContext())); } @Bean public SecurityConfiguration security() { return SecurityConfigurationBuilder.builder() .clientId(swaggerCredentialsProvider.getClientId()) .clientSecret(swaggerCredentialsProvider.getClientSecret()) .scopeSeparator(" ") .useBasicAuthenticationWithAccessCodeGrant(true) .build(); } private SecurityScheme securityScheme() { GrantType grantType = new AuthorizationCodeGrantBuilder() .tokenEndpoint(new TokenEndpoint(tokenEndpoint, "code")) .tokenRequestEndpoint(new TokenRequestEndpoint(tokenRequestEndpoint, swaggerCredentialsProvider.getClientId(), swaggerCredentialsProvider.getClientSecret())) .build(); return new OAuthBuilder().name("spring_oauth") .grantTypes(Collections.singletonList(grantType)) .scopes(Arrays.asList(scopes())).build(); } ... } In this sample code, I give the clientId and the clientSecret and it will display automatically on the swagger-ui Authorization page: In my new implementation of OpenApi Configuration @Bean public OpenAPI customOpenAPI() { OAuthFlow oAuthFlow = new OAuthFlow() .tokenUrl(tokenEndpoint) .authorizationUrl(tokenRequestEndpoint) .scopes(new Scopes().addString(scope, "")); return new OpenAPI() .components(new Components() .addSecuritySchemes("security_auth", new SecurityScheme() .flows(new OAuthFlows().authorizationCode(oAuthFlow)) .type(SecurityScheme.Type.OAUTH2).scheme("oauth2"))) .info(new Info() .title(appName) .version(appVersion) .description(appDescription)); } I do not find a way to set theses information. I tried to set springdoc.swagger-ui.oauth.clientId in the application.property file, but the clientId did not display. How to set the clientId and the clientSecret with OpenApi 3 for displaying automatically on the Authorization Page?How can response status code make sense for multiple media types for error status codes
If we follow the OAS3 spec for Response herewe can see that each response status code can have multiple media types and each media type inturn has a schema particular to it. For example below, we can see 200 has a binary stream response but 400 has 2 media-types:application/json, application/xml. So is client expected to request accept-type header with all the media-types mentioned below. How can we have specific media-type for 400 response code, or basically how we can convey to the REST Service to respond with media type as application/xml when its a 400 bad request if 200 is returning a binary stream. Does this OAS3 response multiple media-type make sense for Client/Server Errors. If yes then whats the accept-type set for expecting, say "application/xml" for 400 bad request '200': description: Document content from the Archive content: application/octet-stream: schema: type: string format: binary '400': description: One or more input parameters are invalid content: application/json: schema: type: "object" properties: errors: $ref: "#/components/schemas/Error_400" application/xml: schema: type: "object" properties: errors: $ref: "#/components/schemas/Error_400" '403': description: Consumer doesn't have access to the document content: application/xml: schema: type: "object" properties: errors: $ref: "#/components/schemas/Error_403"