Skip to content

Commit

Permalink
Merge pull request #40 from inaka/harenson.25.add-basePath-to-trails-…
Browse files Browse the repository at this point in the history
…path

[#25] Add basePath to swaggerSpec
  • Loading branch information
Brujo Benavides committed Dec 2, 2015
2 parents 72f5bba + baf0b34 commit 089a3f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ rel/example_project
.concrete/DEV_MODE
.rebar
.erlang.mk
log
logs
4 changes: 3 additions & 1 deletion src/cowboy_swagger.erl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ to_json(Trails) ->
GlobalSpec = normalize_map_values(
application:get_env(cowboy_swagger, global_spec, Default)),
SanitizeTrails = filter_cowboy_swagger_handler(Trails),
SwaggerSpec = GlobalSpec#{paths => swagger_paths(SanitizeTrails)},
ApiRoot = list_to_binary(trails:api_root()),
SwaggerSpec = GlobalSpec#{paths => swagger_paths(SanitizeTrails),
basePath => ApiRoot},
enc_json(SwaggerSpec).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down

0 comments on commit 089a3f6

Please sign in to comment.