edh_phoenix_swagger v0.1.4 PhoenixSwagger.Path

Defines the swagger path DSL for specifying Controller actions. This module should not be imported directly, it will be automatically imported in the scope of a swagger_path macro body.

Examples

use PhoenixSwagger

swagger_path :index do
  get "/users"
  produces "application/json"
  paging
  parameter :id, :query, :integer, "user id", required: true
  tag "Users"
  response 200 "User resource" :User
  response 404 "User not found"
end

Summary

Functions

Adds a mime-type to the consumes list of the operation of a swagger %PathObject{}

Initializes a Swagger Path DSL block with a delete verb

Adds the description section to the operation of a swagger %PathObject{}

Initializes a Swagger Path DSL block with a get verb

Initializes a Swagger Path DSL block with a head verb

Converts the %PathObject{} struct into the nested JSON form expected by swagger

Adds the operationId section to the operation of a swagger %PathObject{}

Initializes a Swagger Path DSL block with a options verb

Adds page size and page number parameters to the operation of a swagger %PathObject{}

Adds a parameter to the operation of a swagger %PathObject{}

Initializes a Swagger Path DSL block with a post verb

Adds a mime-type to the produces list of the operation of a swagger %PathObject{}

Initializes a Swagger Path DSL block with a put verb

Adds a response to the operation of a swagger %PathObject{}, without a schema

Adds a parameter to the operation of a swagger %PathObject{}, with a schema

Adds the summary section to the operation of a swagger %PathObject{}

Adds a tag to the operation of a swagger %PathObject{}

Functions

consumes(path_object, mimetype)

Adds a mime-type to the consumes list of the operation of a swagger %PathObject{}

delete(path)

Initializes a Swagger Path DSL block with a delete verb

description(path_object, description)

Adds the description section to the operation of a swagger %PathObject{}

get(path)

Initializes a Swagger Path DSL block with a get verb

head(path)

Initializes a Swagger Path DSL block with a head verb

nest(path_object)

Converts the %PathObject{} struct into the nested JSON form expected by swagger

operation_id(path_object, id)

Adds the operationId section to the operation of a swagger %PathObject{}

options(path)

Initializes a Swagger Path DSL block with a options verb

paging(path_object, page_size_arg \\ "page[size]", page_num_arg \\ "page[number]")

Adds page size and page number parameters to the operation of a swagger %PathObject{}

The names default to “page[size]“ and “page[number]“, but can be overridden.

parameter(path_object, name, location, type, description, opts \\ [])

Adds a parameter to the operation of a swagger %PathObject{}

post(path)

Initializes a Swagger Path DSL block with a post verb

produces(path_object, mimetype)

Adds a mime-type to the produces list of the operation of a swagger %PathObject{}

put(path)

Initializes a Swagger Path DSL block with a put verb

response(path_object, status, description)

Adds a response to the operation of a swagger %PathObject{}, without a schema

response(path_object, status, description, schema)

Adds a parameter to the operation of a swagger %PathObject{}, with a schema

summary(path_object, summary)

Adds the summary section to the operation of a swagger %PathObject{}

tag(path_object, tag)

Adds a tag to the operation of a swagger %PathObject{}