View Source cowboy_swagger (cowboy_swagger v2.7.0)
Link to this section Summary
Functions
Returns the swagger json specification from given
trails
. This function basically takes the metadata from each trails:trail()
(which must be compliant with Swagger specification) and builds the required swagger.json
.Link to this section Types
-type metadata() :: trails:metadata(swagger_map()).
-type parameter_definition_name() :: binary().
-opaque parameter_obj()
-type parameters_definition_array() :: #{parameter_definition_name() => #{type => binary(), items => #{type => binary(), properties => property_obj()}}}.
-type parameters_definitions() :: #{parameter_definition_name() => #{type => binary(), properties => property_obj(), _ => _}}.
-type property_desc() :: #{type => binary(), description => binary(), example => binary(), items => property_desc()}.
-type property_obj() :: #{binary() => property_desc()}.
-opaque response_obj()
-type responses_definitions() :: #{binary() => response_obj()}.
-opaque swagger_map()
-type swagger_version() :: swagger_2_0 | openapi_3_0_0.
Link to this section Functions
-spec add_definition(Definition :: parameters_definitions() | parameters_definition_array()) -> ok.
-spec add_definition(Name :: parameter_definition_name(), Properties :: property_obj()) -> ok.
-spec add_definition_array(Name :: parameter_definition_name(), Properties :: property_obj()) -> ok.
-spec get_existing_definitions(CurrentSpec :: jsx:json_term(), Type :: atom() | binary()) -> Definition :: parameters_definitions() | parameters_definition_array().
-spec get_global_spec() -> jsx:json_term().
-spec get_global_spec(jsx:json_term()) -> jsx:json_term().
-spec schema(DefinitionName :: parameter_definition_name()) -> #{<<_:32>> => <<_:64, _:_*8>>}.
-spec set_global_spec(jsx:json_term()) -> ok.
-spec to_json([trails:trail()]) -> jsx:json_text().
trails
. This function basically takes the metadata from each trails:trail()
(which must be compliant with Swagger specification) and builds the required swagger.json
.