Convert old style jsonschema required params to new style.

This commit is contained in:
jakedt 2014-03-17 12:25:41 -04:00
parent 5bb4008880
commit ddf5f2053c
11 changed files with 79 additions and 59 deletions

View file

@ -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,
},
},
},

View file

@ -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,
},
},
},

View file

@ -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',

View file

@ -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,
},
},
},

View file

@ -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',

View file

@ -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,
},
}
}

View file

@ -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,
},
},
},

View file

@ -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,
},
},
},

View file

@ -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,
},
}

View file

@ -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,
},
},
},

View file

@ -21,7 +21,6 @@ class WebhookList(RepositoryParamResource):
'id': 'WebhookCreateRequest',
'type': 'object',
'description': 'Arbitrary json.',
'required': True,
},
}