Skip to content
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

Parser tests + fix for trait deserialisation. #2

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Parser tests + fix for trait deserialisation. #2

wants to merge 17 commits into from

Conversation

JohnRCatlin
Copy link

Hi,

Thanks for sharing your java based AsyncAPI parser; very useful. 👍

I've been exploring it with some unit tests (added) and found a couple of issues.
I've applied a fix for trait deserialisation.

You'll notice that one of the tests fails ... highlighting an issue with the jackson json deserialiser, where it interprets the values on and off to true and false in the streetlights.yml. If these are wrapped in parenthesis then it parses them correctly (but I guess we can't rely on that as the the streetlights.yml seems to comply with the AsyncAPI spec).

See the comments in the test ..

// TODO is this a bug?
// The jackson parser seems to convert the values on and off to true and false.
// It interprets them correctly if we use 'on' and 'off' (see streetlights2.yml).
//System.out.println(schema2.getProperties().get("command"));
assertTrue(schema2.getProperties().get("command").getEnum().contains("on"));
assertTrue(schema2.getProperties().get("command").getEnum().contains("off"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant