Skip to content

Commit

Permalink
feat: add modify and validate, validate all json payloads (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiroaisen authored Jan 15, 2024
2 parents 5a22a53 + e808435 commit c76fc3d
Show file tree
Hide file tree
Showing 82 changed files with 1,832 additions and 302 deletions.
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

0 comments on commit c76fc3d

Please sign in to comment.