-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Portman - Make OpenAPI data immutable (#636)
* Added test for OAS schema validation * Portman - Make OpenAPI data immutable * Portman - Make OpenAPI data immutable * updated changelog
- Loading branch information
Showing
5 changed files
with
188 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
openapi: 3.0.3 | ||
info: | ||
title: 630 - Category API | ||
version: 1.0.0 | ||
|
||
paths: | ||
/categories: | ||
get: | ||
summary: Get a list of categories | ||
responses: | ||
"200": | ||
description: A list of Category Objects | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/CategoriesResponse' | ||
|
||
components: | ||
schemas: | ||
CategoriesResponse: | ||
type: object | ||
properties: | ||
categories: | ||
type: array | ||
items: | ||
oneOf: | ||
- $ref: '#/components/schemas/CategoryObject' | ||
- $ref: '#/components/schemas/CategoryGroupObject' | ||
|
||
CategoryObject: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
description: A system defined unique identifier for the category. | ||
example: 1 | ||
name: | ||
type: string | ||
minLength: 1 | ||
maxLength: 100 | ||
description: The name of the category. | ||
example: Category Name A | ||
is_group: | ||
type: boolean | ||
enum: [false] | ||
description: For CategoryObject, is_group is always false. | ||
example: false | ||
required: | ||
- id | ||
- name | ||
- is_group | ||
|
||
CategoryGroupObject: | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
description: A system defined unique identifier for the category. | ||
example: 3 | ||
name: | ||
type: string | ||
minLength: 1 | ||
maxLength: 100 | ||
description: The name of the category. | ||
example: Category Name A | ||
is_group: | ||
type: boolean | ||
enum: [true] | ||
description: For CategoryGroupObject, is_group is always true. | ||
example: false | ||
group_id: | ||
type: integer | ||
format: int64 | ||
nullable: true | ||
description: The ID of the category group. | ||
example: 1 | ||
required: | ||
- id | ||
- name | ||
- is_group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.