anchor.diff:  %% @hidden
   -spec swagger_paths([trails:trail()]) -> map().
   swagger_paths(Trails) ->
  -  swagger_paths(Trails, #{}).
  +  swagger_paths(Trails, undefined).
  +
  +-spec swagger_paths([trails:trail()], binary() | string() | undefined) -> map().
  +swagger_paths(Trails, BasePath) ->
  +    Paths = trans_swagger_paths(Trails, #{}),
  +    refactor_base_path(Paths, BasePath).
   
   %% @hidden
   -spec validate_metadata(trails:metadata(_)) -> metadata().
  
positive.code: 
  %% @private
  create_swagger_spec(#{swagger := _Version} = GlobalSpec, SanitizeTrails) ->
      GlobalSpec#{paths => swagger_paths(SanitizeTrails)};
  create_swagger_spec(#{openapi := _Version} = GlobalSpec, SanitizeTrails) ->
    GlobalSpec#{paths => swagger_paths(SanitizeTrails)};
  create_swagger_spec(GlobalSpec, SanitizeTrails) ->
    create_swagger_spec(GlobalSpec#{openapi => <<"3.0.0">>}, SanitizeTrails).
  
  %% @private
  validate_swagger_map(Map) ->
  
negative.code:   not maps:get(hidden, Metadata, false).
  
  %% @private
  trans_swagger_paths([], Acc) ->
    Acc;
  trans_swagger_paths([Trail | T], Acc) ->
    Path = normalize_path(trails:path_match(Trail)),
    Metadata = normalize_map_values(validate_metadata(trails:metadata(Trail))),
    trans_swagger_paths(T, maps:put(Path, Metadata, Acc)).
  
  %% @private
  refactor_base_path(PathMap, undefined) ->
    PathMap;
  refactor_base_path(PathMap, BasePath) when is_list(BasePath) ->
    refactor_base_path(PathMap, list_to_binary(BasePath));
  refactor_base_path(PathMap, BasePath) ->
    Fun =
      fun(Path, NextPathMap) ->
        maps:put(remove_base_path(Path, BasePath), maps:get(Path, PathMap), NextPathMap)
      end,
    lists:foldl(Fun, #{}, maps:keys(PathMap)).
  
  %% /base_path/api -> /api
  %% @private
  -spec(remove_base_path(binary(), binary()) -> binary()).
  remove_base_path(Path, BasePath) ->
    BasePathLength = erlang:size(BasePath),
    MatchLength = BasePathLength + 1,
    case binary:match(Path, <<BasePath/binary, "/">>) of
      {0, MatchLength} ->
        binary:part(Path, BasePathLength, erlang:size(Path) - BasePathLength);
      _ ->
        Path
    end.
  
  %% @private
  normalize_path(Path) ->
  