我有JSON模式文件,其中一个属性被定义为string或null:
"type":["string", "null"]
Run Code Online (Sandbox Code Playgroud)
转换为YAML(与OpenAPI/Swagger一起使用)时,它变为:
type:
- 'null'
- string
Run Code Online (Sandbox Code Playgroud)
但Swagger编辑器显示错误:
架构"类型"键必须是字符串
在OpenAPI中定义可空属性的正确方法是什么?
我已经使用 lambda 触发器创建了 aws SQS。我面临的问题是,当从 sqs 发送消息时,lambda 触发器自动断开连接,并且在 cloudwatch 中也不会生成日志(生成日志流)。有人有什么想法吗?
我有一个 node_modules 文件夹,我只想排除几个模块,但在打包时应该添加其他模块。我该怎么做。还有如何使用正则表达式排除某些模块。就像在我的 node_modules 中,我创建了以 md-request、md-models 等开头的自定义模块,所以我只想从打包中排除这些模块。提前致谢。
amazon-web-services node.js aws-lambda serverless-framework serverless
我是aws dynamo db 的新手。我读过我们可以M在 dynamo db 的模式中设置attributeValue 的类型。
但是当我执行下面的代码时
var params = {
TableName: 'product',
KeySchema: [
{
AttributeName: 'productType',
KeyType: 'HASH'
},
{
AttributeName: 'manufacturer',
KeyType: 'SORT'
}
],
AttributeDefinitions: [
{
AttributeName: 'productType',
AttributeType: 'S'
},
{
AttributeName: 'manufacturer',
AttributeType: 'M'
}
],
ProvisionedThroughput: {
ReadCapacityUnits: 1,
WriteCapacityUnits: 1,
}
};
dynamodb.createTable(params, function(err, data) {
console.log(err, data);
});
Run Code Online (Sandbox Code Playgroud)
它不断抛出错误 {"message":"Member must satisfy enum value set: [B, N, S]","code":"ValidationException","time":"2018-02-07T11:20:12.930Z","statusCode":400,"retryable":false}
但是上面的链接说有一个 Map 类型的属性可用。有人可以解释我如何在 dynamo …