Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAWS::Serverless::Api Models only support object type #1559
Comments
|
It looks like SAM enforces having |
|
So I tried removing these two lines and after that
Currently a workaround is to define a "dummy" MyModel:
properties:
dummy: dummy
items:
type: integer
type: array
title: MyModelwhich produces this APIGW model: {
"title" : "MyModel",
"properties" : { },
"type" : "array",
"items" : {
"type" : "integer"
}
}The |
|
@hurlenko yeah it looks like the You would have to run |
|
Hi @keetonian, first time here ! :). I can work in this issue but need to ask something before: Why are we doing this post-validation step as we've just run it for the whole body ? Shouldn't we trust in open api's validation and remove both validations ? |
Description:
Defining api model with type other than
object(specifically without apropertiesattribute) results in validation error.SAM CLI, version 0.43.0
Steps to reproduce the issue:
Modelsproperty to include a model without theproperties(for example typearray) attribute like so:sam validate -t template.yamlObserved result:
An exception is raised:
Expected result:
Successful validation.
Modelssupport all types supported by json schema without requirement forproperties.