Skip to content

Commit

Permalink
host, port and basePath in swagger spec
Browse files Browse the repository at this point in the history
  • Loading branch information
nsolov committed Apr 28, 2020
1 parent 3eb7da7 commit ec7d9d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,10 @@ Response 200:
}
```

## Limitations

Doesn't support multiple items with the same name


## Next steps
* Search messages
Expand Down
8 changes: 6 additions & 2 deletions src/RestProduction/RESTBase.cls
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,14 @@ ClassMethod SwaggerSpec() As %Status
{
Set tSC = ##class(%REST.API).GetWebRESTApplication($NAMESPACE, %request.Application, .swagger)
Do swagger.info.%Remove("x-ISC_Namespace")
Set swagger.basePath = "/production"
If (%request.Application'="/")&&($Extract(%request.Application,*)="/"){
Set swagger.basePath = $Extract(%request.Application,1,*-1)
} Else {
Set swagger.basePath = %request.Application
}
Set swagger.info.title = "REST Production Manager"
Set swagger.info.version = "0.1"
Set swagger.host = "localhost:9098"
Set swagger.host = $Get(%request.CgiEnvs("SERVER_NAME"))_":"_$Get(%request.CgiEnvs("SERVER_PORT"))
Return ..%ProcessResult($$$OK, swagger)
}

Expand Down

0 comments on commit ec7d9d9

Please sign in to comment.