View Source Swagdox.Parser (swagdox v0.1.1)

Parses endpoint docstrings to extract Open API specification data.

Summary

Functions

Extracts the description from a docstring.

Extracts the module docstring from a module.

Extracts the type of configuration and its value from a line in the Open API specification.

Functions

Link to this function

extract_authorizations(docstring)

View Source
@spec extract_authorizations(String.t()) :: [String.t()]
Link to this function

extract_description(docstring)

View Source
@spec extract_description(String.t()) :: String.t()

Extracts the description from a docstring.

Examples:

  iex> extract_description("Creates a User.")
  "Creates a User."
Link to this function

extract_module_doc(module)

View Source
@spec extract_module_doc(module()) :: String.t()

Extracts the module docstring from a module.

@spec extract_name(String.t()) :: String.t()
Link to this function

extract_params(docstring)

View Source
@spec extract_params(String.t()) :: [String.t()]
Link to this function

extract_properties(docstring)

View Source
@spec extract_properties(String.t()) :: [String.t()]
Link to this function

extract_responses(docstring)

View Source
@spec extract_responses(String.t()) :: [String.t()]
Link to this function

extract_security(docstring)

View Source
@spec extract_security(String.t()) :: [String.t()]
@spec parse_definition(String.t()) :: {atom(), list()} | {:error, String.t()}

Extracts the type of configuration and its value from a line in the Open API specification.

Examples:

  iex> parse_definition("@param user(query), map, "User attributes"")
  {:param, [{"user", "query"}, "map", "User attributes"]}