Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add modify and validate, validate all json payloads #249

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 88 additions & 52 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ members = [

"rs/packages/payments",

"rs/packages/modify",
"rs/packages/modify_derive",

"rs/packages/metre",
"rs/packages/metre-macros",
]
Expand Down
4 changes: 3 additions & 1 deletion defs/api/accounts/POST/Payload.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
],
"properties": {
"name": {
"type": "string"
"type": "string",
"maxLength": 60,
"minLength": 1
},
"plan_id": {
"type": "string"
Expand Down
3 changes: 1 addition & 2 deletions defs/api/accounts/[account]/PATCH/Payload.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@
"additionalProperties": true,
"nullable": true
}
},
"additionalProperties": false
}
}
2 changes: 1 addition & 1 deletion defs/api/accounts/[account]/PATCH/Payload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AccountPatch } from "../../../../ops/AccountPatch";

export type Payload = AccountPatch;
export type Payload = {} & AccountPatch;
16 changes: 12 additions & 4 deletions defs/api/admins/POST/Payload.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,24 @@
],
"properties": {
"first_name": {
"type": "string"
"type": "string",
"maxLength": 100,
"minLength": 1
},
"last_name": {
"type": "string"
"type": "string",
"maxLength": 100,
"minLength": 1
},
"email": {
"type": "string"
"type": "string",
"maxLength": 100,
"minLength": 1
},
"password": {
"type": "string"
"type": "string",
"maxLength": 60,
"minLength": 8
},
"system_metadata": {
"type": "object",
Expand Down
7 changes: 5 additions & 2 deletions defs/api/admins/[admin]/PATCH/Payload.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
"properties": {
"first_name": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"nullable": true
},
"last_name": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"nullable": true
},
"system_metadata": {
"type": "object",
"additionalProperties": true,
"nullable": true
}
},
"additionalProperties": false
}
}
2 changes: 1 addition & 1 deletion defs/api/admins/[admin]/PATCH/Payload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AdminPatch } from "../../../../ops/AdminPatch";

export type Payload = AdminPatch;
export type Payload = {} & AdminPatch;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"type": "string"
},
"new_password": {
"type": "string"
"type": "string",
"maxLength": 60,
"minLength": 8
}
}
}
4 changes: 3 additions & 1 deletion defs/api/auth/admin/delegate/[user]/POST/Payload.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
],
"properties": {
"title": {
"type": "string"
"type": "string",
"maxLength": 150,
"minLength": 1
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
],
"properties": {
"new_password": {
"type": "string"
"type": "string",
"maxLength": 60,
"minLength": 8
}
}
}
Loading
Loading