createForSpecificationUrl("/SwaggerFallback.json").build() Seems to fail when file is not in src dir

Issue #394 new
Former user created an issue

Currently facing an issue attempting to read a json file from fatJar packaging where dir structure looks like the following

>io
  >v3
    >parser
     >core
     .
     .
     .
>com
   >attlaisan
   .
   .
   .     
>SwaggerFallback.json

The below code reads the file fine locally

 builder = OpenApiInteractionValidator
          .createForSpecificationUrl("/SwaggerFallback.json")
          .build();

but in a higher env when its packaged up fails silently well not completely it shows this bit in the stacktrace ``` error":{"name":"java.util.ServiceConfigurationError","message":"io.swagger.v3.parser.core.extensions.SwaggerParserExtension: io.swagger.v3.parser.converter.SwaggerConverter Unable to get public no-arg constructor"

sadly can't share the code as it pertains to a private repo, but if theres any advise of how I should be reading the file. would greatly appreciate it.

Comments (2)

  1. Sven Döring

    If it’s still in the fat jar, the URL is wrong. It shall be “classpath:SwaggerFallback.json”.

  2. Log in to comment