2

I have deployed my play 2.4 API based project to heroku. On production the api is seen on /swagger but it also shows some error. On navigating through the error it shows the json.

{
    schemaValidationMessages: [{
        level: "error",
        domain: "validation",
        keyword: "pattern",
        message: "ECMA 262 regex "^/" does not match input string "https://domain.herokuapp.com "",
        schema: {
            loadingURI: "#",
            pointer: "/properties/basePath"
        },
        instance: {
            pointer: "/basePath"
        }
    }]
}

The dependency I have added is

  "io.swagger" %% "swagger-play2" % "1.5.2"

From play prod configuration, I have overrided swagger basepath in my procfile.

-Dswagger.api.basepath=https://domain.herokuapp.com

What could be the reason for the error and how can I remove it?

Thanks

singhakash
  • 7,891
  • 6
  • 31
  • 65

1 Answers1

0

I think that this is the host, the basePath is supposed to be "/". At least this solved it for me

  "host" : "https://domain.herokuapp.com",
  "basePath" : "/",
kopelitsa
  • 3,723
  • 3
  • 20
  • 24