diff --git a/endpoints/api/billing.py b/endpoints/api/billing.py index a9be91200..8bdeba564 100644 --- a/endpoints/api/billing.py +++ b/endpoints/api/billing.py @@ -99,12 +99,13 @@ class UserCard(ApiResource): 'id': 'UserCard', 'type': 'object', 'description': 'Description of a user card', - 'required': True, + 'required': [ + 'token', + ], 'properties': { 'token': { 'type': 'string', 'description': 'Stripe token that is generated by stripe checkout.js', - 'required': True, }, }, }, @@ -137,12 +138,13 @@ class OrganizationCard(ApiResource): 'id': 'OrgCard', 'type': 'object', 'description': 'Description of a user card', - 'required': True, + 'required': [ + 'token', + ], 'properties': { 'token': { 'type': 'string', 'description': 'Stripe token that is generated by stripe checkout.js', - 'required': True, }, }, }, @@ -182,7 +184,9 @@ class UserPlan(ApiResource): 'id': 'UserSubscription', 'type': 'object', 'description': 'Description of a user card', - 'required': True, + 'required': [ + 'plan', + ], 'properties': { 'token': { 'type': 'string', @@ -191,7 +195,6 @@ class UserPlan(ApiResource): 'plan': { 'type': 'string', 'description': 'Plan name to which the user wants to subscribe', - 'required': True, }, }, }, @@ -235,7 +238,9 @@ class OrganizationPlan(ApiResource): 'id': 'OrgSubscription', 'type': 'object', 'description': 'Description of a user card', - 'required': True, + 'required': [ + 'plan', + ], 'properties': { 'token': { 'type': 'string', @@ -244,7 +249,6 @@ class OrganizationPlan(ApiResource): 'plan': { 'type': 'string', 'description': 'Plan name to which the user wants to subscribe', - 'required': True, }, }, }, diff --git a/endpoints/api/build.py b/endpoints/api/build.py index 8cf0af485..f8daafa5a 100644 --- a/endpoints/api/build.py +++ b/endpoints/api/build.py @@ -47,12 +47,13 @@ class RepositoryBuildList(RepositoryParamResource): 'id': 'RepositoryBuildRequest', 'type': 'object', 'description': 'Description of a new repository build.', - 'required': True, + 'required': [ + 'file_id', + ], 'properties': { 'file_id': { 'type': 'string', 'description': 'The file id that was generated when the build spec was uploaded', - 'required': True, }, 'subdirectory': { 'type': 'string', @@ -160,12 +161,13 @@ class FileDropResource(ApiResource): 'id': 'FileDropRequest', 'type': 'object', 'description': 'Description of the file that the user wishes to upload.', - 'required': True, + 'required': [ + 'mimeType', + ], 'properties': { 'mimeType': { 'type': 'string', 'description': 'Type of the file which is about to be uploaded', - 'required': True, }, }, }, diff --git a/endpoints/api/organization.py b/endpoints/api/organization.py index d271309e3..2f521243f 100644 --- a/endpoints/api/organization.py +++ b/endpoints/api/organization.py @@ -46,17 +46,18 @@ class OrganizationList(ApiResource): 'id': 'NewOrg', 'type': 'object', 'description': 'Description of a new organization.', - 'required': True, + 'required': [ + 'name', + 'email', + ], 'properties': { 'name': { 'type': 'string', 'description': 'Organization username', - 'required': True, }, 'email': { 'type': 'string', 'description': 'Organization contact email', - 'required': True, }, }, }, @@ -100,7 +101,6 @@ class Organization(ApiResource): 'id': 'UpdateOrg', 'type': 'object', 'description': 'Description of updates for an existing organization', - 'required': True, 'properties': { 'email': { 'type': 'string', diff --git a/endpoints/api/permission.py b/endpoints/api/permission.py index 417e7eed8..c7307575a 100644 --- a/endpoints/api/permission.py +++ b/endpoints/api/permission.py @@ -87,7 +87,9 @@ class RepositoryUserPermission(RepositoryParamResource): 'id': 'UserPermission', 'type': 'object', 'description': 'Description of a user permission.', - 'required': True, + 'required': [ + 'role', + ], 'properties': { 'role': { 'type': 'string', @@ -97,7 +99,6 @@ class RepositoryUserPermission(RepositoryParamResource): 'write', 'admin', ], - 'required': True, }, }, }, @@ -177,7 +178,9 @@ class RepositoryTeamPermission(RepositoryParamResource): 'id': 'TeamPermission', 'type': 'object', 'description': 'Description of a team permission.', - 'required': True, + 'required': [ + 'role', + ], 'properties': { 'role': { 'type': 'string', @@ -187,7 +190,6 @@ class RepositoryTeamPermission(RepositoryParamResource): 'write', 'admin', ], - 'required': True, }, }, }, diff --git a/endpoints/api/prototype.py b/endpoints/api/prototype.py index 3987941b4..c9098fe2f 100644 --- a/endpoints/api/prototype.py +++ b/endpoints/api/prototype.py @@ -62,12 +62,14 @@ class PermissionPrototypeList(ApiResource): 'id': 'NewPrototype', 'type': 'object', 'description': 'Description of a new prototype', - 'required': True, + 'required': [ + 'role', + 'delegate', + ], 'properties': { 'role': { 'type': 'string', 'description': 'Role that should be applied to the delegate', - 'required': True, 'enum': [ 'read', 'write', @@ -77,28 +79,31 @@ class PermissionPrototypeList(ApiResource): 'activating_user': { 'type': 'object', 'description': 'Repository creating user to whom the rule should apply', + 'required': [ + 'name', + ], 'properties': { 'name': { 'type': 'string', 'description': 'The username for the activating_user', - 'required': True, }, }, }, 'delegate': { 'type': 'object', 'description': 'Information about the user or team to which the rule grants access', - 'required': True, + 'required': [ + 'name', + 'kind', + ], 'properties': { 'name': { 'type': 'string', 'description': 'The name for the delegate team or user', - 'required': True, }, 'kind': { 'type': 'string', 'description': 'Whether the delegate is a user or a team', - 'required': True, 'enum': [ 'user', 'team', @@ -183,12 +188,13 @@ class PermissionPrototype(ApiResource): 'id': 'PrototypeUpdate', 'type': 'object', 'description': 'Description of a the new prototype role', - 'required': True, + 'required': [ + 'role', + ], 'properties': { 'role': { 'type': 'string', 'description': 'Role that should be applied to the permission', - 'required': True, 'enum': [ 'read', 'write', diff --git a/endpoints/api/repository.py b/endpoints/api/repository.py index 59a30c224..9dba49a47 100644 --- a/endpoints/api/repository.py +++ b/endpoints/api/repository.py @@ -27,12 +27,14 @@ class RepositoryList(ApiResource): 'id': 'NewRepo', 'type': 'object', 'description': 'Description of a new repository', - 'required': True, + 'required': [ + 'repository', + 'visibility', + ], 'properties': { 'repository': { 'type': 'string', 'description': 'Repository name', - 'required': True, }, 'visibility': { 'type': 'string', @@ -41,7 +43,6 @@ class RepositoryList(ApiResource): 'public', 'private', ], - 'required': True, }, 'namespace': { 'type': 'string', @@ -155,12 +156,13 @@ class Repository(RepositoryParamResource): 'id': 'RepoUpdate', 'type': 'object', 'description': 'Fields which can be updated in a repository.', - 'required': True, + 'required': [ + 'description', + ], 'properties': { 'description': { 'type': 'string', 'description': 'Markdown encoded description for the repository', - 'required': True, }, } } @@ -250,7 +252,9 @@ class RepositoryVisibility(RepositoryParamResource): 'id': 'ChangeVisibility', 'type': 'object', 'description': 'Change the visibility for the repository.', - 'required': True, + 'required': [ + 'visibility', + ], 'properties': { 'visibility': { 'type': 'string', @@ -259,7 +263,6 @@ class RepositoryVisibility(RepositoryParamResource): 'public', 'private', ], - 'required': True, }, } } diff --git a/endpoints/api/repotoken.py b/endpoints/api/repotoken.py index ca806ad3e..577abf638 100644 --- a/endpoints/api/repotoken.py +++ b/endpoints/api/repotoken.py @@ -27,12 +27,13 @@ class RepositoryTokenList(RepositoryParamResource): 'id': 'NewToken', 'type': 'object', 'description': 'Description of a new token.', - 'required': True, + 'required':[ + 'friendlyName', + ], 'properties': { 'friendlyName': { 'type': 'string', 'description': 'Friendly name to help identify the token', - 'required': True, }, }, }, @@ -73,7 +74,9 @@ class RepositoryToken(RepositoryParamResource): 'id': 'TokenPermission', 'type': 'object', 'description': 'Description of a token permission', - 'required': True, + 'required': [ + 'role', + ], 'properties': { 'role': { 'type': 'string', @@ -83,7 +86,6 @@ class RepositoryToken(RepositoryParamResource): 'write', 'admin', ], - 'required': True, }, }, }, diff --git a/endpoints/api/team.py b/endpoints/api/team.py index 6b342e596..065e64a88 100644 --- a/endpoints/api/team.py +++ b/endpoints/api/team.py @@ -35,12 +35,14 @@ class OrganizationTeam(ApiResource): 'id': 'TeamDescription', 'type': 'object', 'description': 'Description of a team', - 'required': True, + 'required': [ + 'role', + 'description', + ], 'properties': { 'role': { 'type': 'string', 'description': 'Org wide permissions that should apply to the team', - 'required': True, 'enum': [ 'member', 'creator', @@ -50,7 +52,6 @@ class OrganizationTeam(ApiResource): 'description': { 'type': 'string', 'description': 'Markdown description for the team', - 'required': True, }, }, }, diff --git a/endpoints/api/trigger.py b/endpoints/api/trigger.py index 9c5ccc698..e76876e1e 100644 --- a/endpoints/api/trigger.py +++ b/endpoints/api/trigger.py @@ -106,7 +106,6 @@ class BuildTriggerSubdirs(RepositoryParamResource): 'id': 'BuildTriggerSubdirRequest', 'type': 'object', 'description': 'Arbitrary json.', - 'required': True, }, } @@ -150,7 +149,6 @@ class BuildTriggerActivate(RepositoryParamResource): 'id': 'BuildTriggerActivateRequest', 'type': 'object', 'description': 'Arbitrary json.', - 'required': True, }, } diff --git a/endpoints/api/user.py b/endpoints/api/user.py index 2d1c815e2..1d5ccf13e 100644 --- a/endpoints/api/user.py +++ b/endpoints/api/user.py @@ -67,22 +67,23 @@ class User(ApiResource): 'id': 'NewUser', 'type': 'object', 'description': 'Fields which must be specified for a new user.', - 'required': True, + 'required': [ + 'username', + 'password', + 'email', + ], 'properties': { 'username': { 'type': 'string', 'description': 'The user\'s username', - 'required': True, }, 'password': { 'type': 'string', 'description': 'The user\'s password', - 'required': True, }, 'email': { 'type': 'string', 'description': 'The user\'s email address', - 'required': True, }, } }, @@ -90,7 +91,6 @@ class User(ApiResource): 'id': 'UpdateUser', 'type': 'object', 'description': 'Fields which can be updated in a user.', - 'required': True, 'properties': { 'password': { 'type': 'string', @@ -225,22 +225,23 @@ class ConvertToOrganization(ApiResource): 'id': 'ConvertUser', 'type': 'object', 'description': 'Information required to convert a user to an organization.', - 'required': True, + 'required': [ + 'username', + 'password', + 'email', + ], 'properties': { 'username': { 'type': 'string', 'description': 'The user\'s username', - 'required': True, }, 'password': { 'type': 'string', 'description': 'The user\'s password', - 'required': True, }, 'email': { 'type': 'string', 'description': 'The user\'s email address', - 'required': True, }, }, }, @@ -286,17 +287,18 @@ class Signin(ApiResource): 'id': 'SigninUser', 'type': 'object', 'description': 'Information required to sign in a user.', - 'required': True, + 'required': [ + 'username', + 'password', + ], 'properties': { 'username': { 'type': 'string', 'description': 'The user\'s username', - 'required': True, }, 'password': { 'type': 'string', 'description': 'The user\'s password', - 'required': True, }, }, }, @@ -337,12 +339,13 @@ class Recovery(ApiResource): 'id': 'RequestRecovery', 'type': 'object', 'description': 'Information required to sign in a user.', - 'required': True, + 'required': [ + 'email', + ], 'properties': { 'email': { 'type': 'string', 'description': 'The user\'s email address', - 'required': True, }, }, }, diff --git a/endpoints/api/webhook.py b/endpoints/api/webhook.py index c8751097d..9e9dbf5ca 100644 --- a/endpoints/api/webhook.py +++ b/endpoints/api/webhook.py @@ -21,7 +21,6 @@ class WebhookList(RepositoryParamResource): 'id': 'WebhookCreateRequest', 'type': 'object', 'description': 'Arbitrary json.', - 'required': True, }, }