Mercurial > prosody-modules
comparison mod_rest/apidemo.lib.lua @ 5650:0eb2d5ea2428
merge
author | Stephen Paul Weber <singpolyma@singpolyma.net> |
---|---|
date | Sat, 06 May 2023 19:40:23 -0500 |
parents | d03448560acf |
children |
comparison
equal
deleted
inserted
replaced
5649:2c69577b28c2 | 5650:0eb2d5ea2428 |
---|---|
25 index = index:gsub("(%s*SwaggerUIBundle%s*%(%s*{)(%s*)", "%1%2validatorUrl: false,%2"); | 25 index = index:gsub("(%s*SwaggerUIBundle%s*%(%s*{)(%s*)", "%1%2validatorUrl: false,%2"); |
26 end | 26 end |
27 | 27 |
28 do | 28 do |
29 local f = module:load_resource("res/openapi.yaml"); | 29 local f = module:load_resource("res/openapi.yaml"); |
30 local openapi = f:read("*a"); | |
31 openapi = openapi:gsub("https://example%.com/oauth2", module:http_url("oauth2")); | |
30 _M.schema = { | 32 _M.schema = { |
31 headers = { | 33 headers = { |
32 content_type = "text/x-yaml"; | 34 content_type = "text/x-yaml"; |
33 }; | 35 }; |
34 body = f:read("*a"); | 36 body = openapi; |
35 } | 37 } |
36 f:close(); | 38 f:close(); |
37 end | 39 end |
38 | 40 |
39 _M.redirect = { | 41 _M.redirect = { |