0

My OenApiConfiguration looks like

@Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI().info(apiInfo()).components(new Components().addSecuritySchemes(OAUTH2, securityScheme()))
                .addSecurityItem(new SecurityRequirement().addList(OAUTH2));
    }

 

    private Info apiInfo() {
        return new Info()
                .title(API_TITLE)
                .description(API_DESC)
                .version(API_VER)
                .license(apiLicence());
    }

    private SecurityScheme securityScheme() {
        return new SecurityScheme()
                .type(SecurityScheme.Type.OAUTH2)
                .flows(securityFlows());

 

    }
        private OAuthFlows securityFlows() {
            OAuthFlow passwordFlow = new OAuthFlow()
                    .tokenUrl(Properties.getAppOauthSwaggerUrl());
            return new OAuthFlows()
                    .password(passwordFlow);
        }
        private License apiLicence() {
            return new License()
                    .name(API_LICENSE)
                    .url(Properties.getAppOauthLicenseUrl());
        }
        @Bean
        SecurityConfiguration security() {
            return SecurityConfigurationBuilder.
                    builder().
                    clientId(Properties.getAppOauthClientId()).clientSecret(Properties.getAppOauthclientSecret())
                    .appName(app).build();
        }

and dependencies added for generating open api are

<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.1.0</version>
</dependency>

but generated open api looks like [123,34,111,112,101,110,97,112,105,34,58,34,51,46,48,46,49,34,44,34,105,110,102,111,34,58,123,34,116,105,116,108,101,34,58,34,80,108,97,116,102,111,114,109,32,78,83,76,45,83,101,99,77,99,99,32,82,69,83,84,32,65,80,73,34,44,34,100,101,115,99,114,105,112,116,105,111,110,34,58,34,83,116,114,117,99,116,117,114,97,108,32,82,101,115,116,32,65,80,73,34,44,34,108,105,99,101,110,115,101,34,58,123,34,110,97,109,101,34,58,34,78,83,76,72,85,66,34,44,34,117,114,108,34,58,34,104,116,116,112,115,58,47,47,119,119,119,46,110,115,108,104,117,98,46,99,111,109,34,125,44,34,118,101,114,115,105,111,110,34,58,34,118,49,34,125,44,34,115,101,114,118,101,114,115,34,58,91,123,34,117,114,108,34,58,34,104,116,116,112,58,47,47,108,111,99,97,108,104,111,115,116,58,57,48,57,53,47,115,101,99,109,99,99,34,44,34,100,101,115,99,114,105,112,116,105,111,110,34,58,34,71,101,110,101,114,97,116,101,100,32,115,101,114,118,101,114,32,117,114,108,34,125,93,44,34,115,101,99,117,114,105,116,121,34,58,91,123,34,111,97,117,116,104,50,34,58,91,93,125,93,44,34,112,97,116,104,115,34,58,123,125,44,34,99,111,109,112,111,110,101,110,116,115,34,58,123,34,115,101,99,117,114,105,116,121,83,99,104,101,109,101,115,34,58,123,34,111,97,117,116,104,50,34,58,123,34,116,121,112,101,34,58,34,111,97,117,116,104,50,34,44,34,102,108,111,119,115,34,58,123,34,112,97,115,115,119,111,114,100,34,58,123,34,116,111,107,101,110,85,114,108,34,58,34,104,116,116,112,115,58,47,47,105,97,109,46,110,115,108,104,117,98,46,99,111,109,47,97,117,116,104,47,114,101,97,108,109,115,47,112,116,101,115,116,114,57,49,56,47,112,114,111,116,111,99,111,108,47,111,112,101,110,105,100,45,99,111,110,110,101,99,116,47,116,111,107,101,110,34,125,125,125,125,125,125]

can anyone tell why open api is being generating in this way?

virot
  • 1
  • 2
  • For me, the output seems to be a String which is interpreted as Array so that you get the ASCII-Numbers there. Is there anything in your Application that can be responsible for this kind of behaviour? Have you set the Responsetype or is ther any kind of filter? – waXve Jul 21 '23 at 10:23

0 Answers0