gabledata / recap

Work with your web service, database, and streaming schemas in a single format.
https://recap.build
MIT License
334 stars 24 forks source link

Add UnknownType and use in converters #430

Open mjperrone opened 8 months ago

mjperrone commented 8 months ago

Addresses https://github.com/recap-build/recap/issues/429

Adds a new type UnknownType for situations where converters can't figure out an appropriate existing recap type.

This does not have comprehensive test cases and I'm not sure this is the right way to go for all these converters, but I wanted to get started on this so we can discuss and collaborate on it.

Made a PR for the website/json schema update: https://github.com/recap-build/recap-website/pull/16

Validation

We will need to add a bunch of tests for the converters, parser, and for the JSON schema validation.

criccomini commented 8 months ago

Great, thanks! I'll take a look tomorrow.

One thing I noticed in the website PR was that it seems like you might be modifying the CST to add an "unknown" type. This was something I mentioned wanting to avoid in #429:

If we went this route, I wouldn't want to add an unknown to the CST, but rather keep UnknownType as only an AST class similar to ProxyType.

I'll take a look and see if we can get away without adding "unknown" as a concrete syntax.

mjperrone commented 8 months ago

Ah yes, forgot/missed that. Thanks for taking a look

mjperrone commented 7 months ago

I don't think I will be able to make another iteration on this for several more weeks

criccomini commented 7 months ago

No worries, there's nothing pressing on my end.