Teiid Swagger translator
by Van Dillon
Hi,
I'm starting to work with Teiid and would like to know what the procedure
is for contributing.
I've been working with the Swagger translator and have found a few bugs and
also have an enhancement I'd like to suggest.
Bugs
1) JsonSerializer.deserialize with an unnamed array
If a Rest endpoint is called that returns an unnamed array such as:
[
{
"scheduleId": 10007,
"timeStamp": 1468000572174,
"value": 2813018112
},
{
"scheduleId": 10007,
"timeStamp": 1468000602173,
"value": 2817523712
}
]
the JsonSerializer.deserialize method throws an EmptyStackException in the
END_ARRAY case because the 'fieldName' stack is empty. A check for empty
in the if clause fixes the problem:
if (arrayLevel > objectLevel && !fieldName.empty())...
2) DDL generation
When the schema DDL is generated from the Swagger, all procedure parameters
have their NullType set to NullType.No_Nulls. Can this be set depending on
the Swagger parameter 'required' field? For instance:
boolean required = parameter.getRequired();
pp.setNullType(required ? NullType.No_Nulls : NullType.Nullable);
Enhancement idea:
REST apis that are not Swagger based could be used with the Swagger
translator if a user could provide a swagger.json file they've created in
the Swagger Editor. I've added some changes to SwaggerMetadataProcessor
that allow a user to specify an importer property, swaggerFilePath, that's
used in the getSchema method to load the Swagger metadata from file.
Please let me know if you'd like me to contribute these changes.
Thank,
Van
8 years, 5 months