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
layers schema #8299
layers schema #8299
Changes from 1 commit
16670dc
12df47b
64ab4be
f0c3959
cdd2341
5923f42
932287c
aa03ffe
bdb4d50
8c02569
eb40629
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,19 @@ | |
|
||
const functionNamePattern = '^[a-zA-Z0-9-_]+$'; | ||
|
||
const packageSchema = { | ||
type: 'object', | ||
properties: { | ||
individually: { type: 'boolean' }, | ||
path: { type: 'string' }, | ||
artifact: { type: 'string' }, | ||
exclude: { type: 'array', items: { type: 'string' } }, | ||
include: { type: 'array', items: { type: 'string' } }, | ||
excludeDevDependencies: { type: 'boolean' }, | ||
}, | ||
additionalProperties: false, | ||
}; | ||
|
||
const schema = { | ||
type: 'object', | ||
properties: { | ||
|
@@ -96,22 +109,42 @@ const schema = { | |
additionalProperties: false, | ||
}, | ||
|
||
package: { | ||
package: packageSchema, | ||
|
||
layers: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an AWS specific property, so I think we should define it in context o AWS provider, in same way as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So should I remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe it should be moved completely, exactly in a same way as |
||
type: 'object', | ||
properties: { | ||
individually: { type: 'boolean' }, | ||
path: { type: 'string' }, | ||
artifact: { type: 'string' }, | ||
exclude: { type: 'array', items: { type: 'string' } }, | ||
include: { type: 'array', items: { type: 'string' } }, | ||
excludeDevDependencies: { type: 'boolean' }, | ||
additionalProperties: { | ||
type: 'object', | ||
properties: { | ||
allowedAccounts: { | ||
type: 'array', | ||
items: { | ||
oneOf: [ | ||
{ type: 'integer', minimum: 100000000000, maximum: 999999999999 }, | ||
{ type: 'string', pattern: '^\\d{12}$' }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
{ const: '*' }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would remove it and rely on pattern as in AWS docs |
||
], | ||
}, | ||
}, | ||
compatibleRuntimes: { type: 'array', items: { type: 'string' }, maxItems: 5 }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'll be good to rely on |
||
description: { type: 'string', maxLength: 256 }, | ||
licenseInfo: { type: 'string', maxLength: 512 }, | ||
name: { | ||
type: 'string', | ||
minLength: 1, | ||
maxLength: 140, | ||
pattern: | ||
'^((arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+)$', | ||
}, | ||
package: packageSchema, | ||
path: { type: 'string' }, | ||
retain: { type: 'boolean' }, | ||
}, | ||
required: ['path'], | ||
additionalProperties: false, | ||
}, | ||
additionalProperties: false, | ||
}, | ||
|
||
// TODO: Complete schema, see https://github.com/serverless/serverless/issues/8015 | ||
layers: { type: 'object' }, | ||
|
||
/* | ||
* Modes for config validation: | ||
* - error: the error is thrown | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I inspect the code we only support
artifact
,include
andexclude
property onlayer.package
, so schema should be different from top levelpackage
property, and I think best to treat both as different.