Skip to content

Instantly share code, notes, and snippets.

@sytolk
Created May 4, 2020 15:16
Show Gist options
  • Save sytolk/e7ee6715e9d3949569b4a76749d3848c to your computer and use it in GitHub Desktop.
Save sytolk/e7ee6715e9d3949569b4a76749d3848c to your computer and use it in GitHub Desktop.
openapi.json
{
"components" : {
"schemas" : {
"Category" : {
"properties" : {
"adminRole" : {
"description" : "The adminRole.",
"type" : "string"
},
"background_color" : {
"description" : "The Category background_color.",
"type" : "string"
},
"categoryId" : {
"description" : "The internal ID.",
"format" : "int64",
"type" : "integer"
},
"color" : {
"description" : "The Category color.",
"type" : "string"
},
"companyId" : {
"description" : "The companyId.",
"format" : "int64",
"type" : "integer"
},
"editRole" : {
"description" : "The editRole.",
"type" : "string"
},
"name" : {
"description" : "The Category name.",
"type" : "string"
}
},
"type" : "object",
"xml" : {
"name" : "Category"
}
},
"News" : {
"properties" : {
"attachment_url" : {
"type" : "string"
},
"categoryId" : {
"$ref" : "#/components/schemas/Category"
},
"companyId" : {
"format" : "int64",
"type" : "integer"
},
"date_from" : {
"format" : "int64",
"type" : "integer"
},
"date_to" : {
"format" : "int64",
"type" : "integer"
},
"description" : {
"type" : "string"
},
"newsId" : {
"description" : "The internal ID.",
"format" : "int64",
"type" : "integer"
},
"title" : {
"type" : "string"
}
},
"type" : "object",
"xml" : {
"name" : "News"
}
},
"PageNews" : {
"properties" : {
"items" : {
"items" : {
"$ref" : "#/components/schemas/News"
},
"type" : "array"
},
"lastPage" : {
"format" : "int64",
"type" : "integer"
},
"totalCount" : {
"format" : "int64",
"type" : "integer"
},
"page" : {
"format" : "int64",
"type" : "integer"
},
"pageSize" : {
"format" : "int64",
"type" : "integer"
},
"actions" : {
"additionalProperties" : {
"additionalProperties" : {
"type" : "string"
},
"type" : "object"
},
"type" : "object"
}
},
"type" : "object"
}
}
},
"info" : {
"description" : "API for accessing News details.",
"title" : "Headless News Api",
"version" : "v1.0"
},
"openapi" : "3.0.1",
"paths" : {
"/v1.0/news/{newsId}" : {
"delete" : {
"description" : "Deletes the News and returns a 204 if the operation succeeds.",
"operationId" : "deleteNews",
"parameters" : [ {
"in" : "path",
"name" : "newsId",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"default" : {
"content" : {
"application/json" : { },
"application/xml" : { }
},
"description" : "default response"
}
},
"tags" : [ "News" ]
},
"get" : {
"description" : "Retrieves the News via its ID.",
"operationId" : "getNews",
"parameters" : [ {
"in" : "path",
"name" : "newsId",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"default" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
},
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
}
},
"description" : "default response"
}
},
"tags" : [ "News" ]
},
"patch" : {
"description" : "Replaces the News with the information sent in the request body. Any missing fields are deleted, unless they are required.",
"operationId" : "patchNews",
"parameters" : [ {
"in" : "path",
"name" : "newsId",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
},
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
}
}
},
"responses" : {
"default" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
},
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
}
},
"description" : "default response"
}
},
"tags" : [ "News" ]
},
"put" : {
"description" : "Replaces the News with the information sent in the request body. Any missing fields are deleted, unless they are required.",
"operationId" : "putNews",
"parameters" : [ {
"in" : "path",
"name" : "newsId",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
},
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
}
}
},
"responses" : {
"default" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
},
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
}
},
"description" : "default response"
}
},
"tags" : [ "News" ]
}
},
"/v1.0/news" : {
"get" : {
"description" : "Retrieves the list of News. Results can be paginated, filtered, searched, and sorted.",
"operationId" : "getNewsPage",
"parameters" : [ {
"in" : "query",
"name" : "search",
"schema" : {
"type" : "string"
}
}, {
"in" : "query",
"name" : "filter",
"schema" : {
"type" : "string"
}
}, {
"in" : "query",
"name" : "page",
"schema" : {
"type" : "string"
}
}, {
"in" : "query",
"name" : "pageSize",
"schema" : {
"type" : "string"
}
}, {
"in" : "query",
"name" : "sort",
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"default" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/PageNews"
}
},
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/PageNews"
}
}
},
"description" : "default response"
}
},
"tags" : [ "News" ]
},
"post" : {
"description" : "Create a new News.",
"operationId" : "postNews",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
},
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
}
}
},
"responses" : {
"default" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
},
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/News"
}
}
},
"description" : "default response"
}
},
"tags" : [ "News" ]
}
},
"/v1.0/openapi.{type}" : {
"get" : {
"operationId" : "getOpenAPI",
"parameters" : [ {
"in" : "path",
"name" : "type",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"default" : {
"content" : {
"application/json" : { },
"application/yaml" : { }
},
"description" : "default response"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment