Thank you Andriy. Somehow I am not able to get it working with
OpenAPICustomizer. This is what I have in my class and I get a 404 when I
access it

public OpenApiFeature createOpenApiFeature() {
OpenApiFeature openApiFeature = new OpenApiFeature();
openApiFeature.setPrettyPrint(true);
Set<String> resourcePackages = new HashSet<String>();
resourcePackages.add("demo.test.rest");

openApiFeature.setResourcePackages(resourcePackages);
OpenApiCustomizer customizer = new OpenApiCustomizer();
customizer.setDynamicBasePath(true);
openApiFeature.setCustomizer(customizer);
return openApiFeature;


Should I also a URL for my service ?  I do not see any option for that.

Also, if I want to disable OpenAPI from openapi-configuration.json then how
can we do that ? I can change the "resourcePackages" but would like to know
if there is a better approach something like  property "support.swagger.ui".

On Wed, Sep 12, 2018 at 6:44 AM Andriy Redko <[email protected]> wrote:

> Hi Irfan,
>
> The OpenApiFeature has setResourcePackages method to limit the scope of
> resource scanning. Most of the openapi-configuration.json could be
> translated into
> OpenApiFeature properties. The OpenApiCustomizer is a good tool in a few
> cases, when
> there is a need to perform manipulations with the specification at runtime
> (f.e.
> dynamicBasePath, ...). Thanks!
>
> Best Regards,
>     Andriy Redko
>
> IP> Hi,
>
> IP> Is there a way to add resourcePackages to OpenAPICustomizer from the
> code
> IP> so that I can completely  skip openapi-configuration.json ? I see that
> IP> OpenAPICustomizer has the method "setClassResourceInfos", but it seems
> to
> IP> be overkill to perform the task I was looking for.
>
> IP> Appreciate your time to respond to my questions !
>
> IP> Regards,
> IP> Irfan
>
>

-- 
irfan..........................

Reply via email to