Operation

Summary

An operation available to an API path.

Description

An operation details the actions available to an API. The method, nickname, summary, and type are required.

Fields

Field Name Type Since Version Description
tags Map The list of tags associated with this API operation. Each tag can have multiple values
securityProfile SwaggerSecurityProfile The security profile associated with the API Method. This profile will override the profile associated with the API
documentationUrl String The documentation URL for the operation
cors Boolean Indicates that the API is CORS enabled
type String The return type of the method, e.g. void, array, or a type found in models
parameters [Parameter] A list of accepted parameters
responseClass String The return type of the method, e.g. void, array, or a type found in models
httpMethod String The HTTP method
nickname String The nickname of the operation
summary String A short summary description of the operation
notes String A detailed description of the operation
responseClass String The return type of the method, e.g. void, array, or a type found in models
errorResponses [ErrorResponse] A list of possible response messages and their meanings
consumes [String] The content types that the operation consumes
produces [String] The content types that the operation produces
authorizations Map Authorizations
deprecated Boolean Declares whether this operation is deprecated
id String An identifier
ref String A Reference to a definition on defitions object
title String Shema title
description String Description about the Schema
defaultValue Object Default value for this schema if it is applicable
type String The type ex: array , boolean, integer , null , number, object, string
format String The format ex: int32, int64, float, double, byte, binary, date, date-time or password
required [String] Specifies if the paramater is required
properties {String, SchemaObject} Not used beacause our model does not support inline nested types
items SchemaObject if the schema is an array specifies the items type
example Object if the schema is an array specifies the items type
exclusiveMinimum Boolean
maxLength Int
minLength Int
pattern String
maxItems Int
minItems Int
uniqueItems Boolean
multipleOf Int
collectionFormat String
enumList [String]
discriminator String none

Example JSON

{
  "id" : "",
  "format" : "",
  "httpMethod" : "GET",
  "nickname" : "getUserById",
  "summary" : "Gets a user by ID",
  "notes" : "If the user does not exist, then a *404 Not Found* error is returned",
  "responseClass" : "User",
  "errorResponses" : [ {
    "id" : "",
    "format" : "",
    "code" : 404,
    "reason" : "Not Found",
    "$ref" : "#/definitions/User",
    "type" : "string"
  } ],
  "consumes" : [ "\"application/json\"" ],
  "produces" : [ "\"application/json\"" ],
  "authorizations" : { },
  "tags" : {
    "Category" : [ "Social Network", "Photos" ],
    "Type" : [ "REST" ],
    "Department" : [ "Development" ]
  },
  "securityProfile" : {
    "devices" : [ {
      "type" : "APIKeyOnlySecurityDevice",
      "typeDisplayName" : "API Key only",
      "name" : "API Key Device",
      "order" : 1,
      "keyField" : "KeyId"
    }, {
      "type" : "HTTPBasicSecurityDevice",
      "typeDisplayName" : "HTTP Basic Authentication",
      "name" : "HTTP Basic Device",
      "order" : 0,
      "realm" : "axway"
    } ]
  },
  "documentationUrl" : "http://api.acme.com/docs#method",
  "cors" : true,
  "parameters" : [ {
    "id" : "",
    "format" : "",
    "required" : true,
    "name" : "userId",
    "dataType" : "string",
    "paramType" : "body",
    "allowMultiple" : false,
    "$ref" : "#/definitions/User",
    "defaultValue" : "Sample Value",
    "type" : "string"
  } ],
  "$ref" : "#/definitions/User",
  "type" : "User"
}