Forum Discussion
Anonymous
6 years agoNot applicable
OpenApi document swagger
Hi, dax ImkeF , I have a question I am loading a swagger.json file using openApi.documet, which is fine. But if I dont specify the host in swagger.json, the host should be picked up automatica...
- Anonymous6 years ago
ImkeF Found a solution after various thoughts!
read the whole json object from swagger and then append the host dynamically, before passing the json contents to the open API. document.
Here's the snippet:
swagger = Json.Document(Extension.Contents("swagger.json")), swaggerRecord = Record.AddField(swagger, "host", biHost), // biHost eg: localhost:80
// OpenApi.Document will return a navigation table apiFunctionTable = OpenApi.Document(Binary.From(Json.FromValue(swaggerRecord)), DefaultOptions)Thanks!
Anonymous
6 years agoNot applicable
ImkeF Found a solution after various thoughts!
read the whole json object from swagger and then append the host dynamically, before passing the json contents to the open API. document.
Here's the snippet:
swagger = Json.Document(Extension.Contents("swagger.json")),
swaggerRecord = Record.AddField(swagger, "host", biHost), // biHost eg: localhost:80
// OpenApi.Document will return a navigation table
apiFunctionTable = OpenApi.Document(Binary.From(Json.FromValue(swaggerRecord)), DefaultOptions)Thanks!