Pravda v0.6.1 Pravda.Core View Source
Documentation for Pravda core.
Link to this section Summary
Functions
Compile Paths is the function used to take a list of spec files and compile them into a list of routes we can validate with.
phoenix_route_to_schema takes a connections current path location and method and outputs a url that will match an openapi schema base definition it uses the router to correctly resolve the name and order of path arguments
validate_body is used to validate the input body for a spec, for a specific method, path.
validate params takes in and validates headers, path, and query parameters against the spec
validate_response is used to validate the responses section for a spec, for a specific method, path, and status.
Link to this section Functions
Compile Paths is the function used to take a list of spec files and compile them into a list of routes we can validate with.
phoenix_route_to_schema(conn, router)
View Sourcephoenix_route_to_schema(Plug.Conn.t(), module()) :: {String.t(), String.t()} | {nil, nil}
phoenix_route_to_schema takes a connections current path location and method and outputs a url that will match an openapi schema base definition it uses the router to correctly resolve the name and order of path arguments
validate_body is used to validate the input body for a spec, for a specific method, path.
validate params takes in and validates headers, path, and query parameters against the spec
validate_response is used to validate the responses section for a spec, for a specific method, path, and status.