fix(coding): tighten Pi Data Service schemas
This commit is contained in:
@@ -327,7 +327,10 @@ export default function makeloreRuntime(pi) {
|
||||
type: 'object', additionalProperties: false, required: ['collection', 'document_id'],
|
||||
properties: {
|
||||
collection: { type: 'string', minLength: 1, maxLength: 48, pattern: '^[a-z][a-z0-9_-]{0,47}$' },
|
||||
document_id: { type: 'string', minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9._~-]{1,128}$' },
|
||||
document_id: {
|
||||
type: 'string', minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9._~-]{1,128}$',
|
||||
not: { enum: ['.', '..'] },
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
@@ -355,9 +358,12 @@ export default function makeloreRuntime(pi) {
|
||||
required: ['collection', 'document_id', 'data'],
|
||||
properties: {
|
||||
collection: { type: 'string', minLength: 1, maxLength: 48, pattern: '^[a-z][a-z0-9_-]{0,47}$' },
|
||||
document_id: { type: 'string', minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9._~-]{1,128}$' },
|
||||
document_id: {
|
||||
type: 'string', minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9._~-]{1,128}$',
|
||||
not: { enum: ['.', '..'] },
|
||||
},
|
||||
data: { type: 'object' },
|
||||
if_revision: { type: 'integer', minimum: 1 },
|
||||
if_revision: { type: 'integer', minimum: 1, maximum: 9007199254740991 },
|
||||
},
|
||||
},
|
||||
);
|
||||
@@ -371,8 +377,11 @@ export default function makeloreRuntime(pi) {
|
||||
required: ['collection', 'document_id', 'confirmed'],
|
||||
properties: {
|
||||
collection: { type: 'string', minLength: 1, maxLength: 48, pattern: '^[a-z][a-z0-9_-]{0,47}$' },
|
||||
document_id: { type: 'string', minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9._~-]{1,128}$' },
|
||||
if_revision: { type: 'integer', minimum: 1 },
|
||||
document_id: {
|
||||
type: 'string', minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9._~-]{1,128}$',
|
||||
not: { enum: ['.', '..'] },
|
||||
},
|
||||
if_revision: { type: 'integer', minimum: 1, maximum: 9007199254740991 },
|
||||
confirmed: { type: 'boolean', const: true },
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user