-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Fields included via $allOf into AsyncAPI messages are not constrained correctly #1611
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. |
Hi, I was trying to reproduce your issue, but it seems fine here: https://github.com/asyncapi/modelina/pull/1614/files |
@kennethaasan there is a link above to a CodeSandbox which reproduces the issue - you shouldn't have to log in or sign up for anything to view it. Perhaps it's been fixed on |
There is a difference between your test and the example I provided - the use of |
Sounds like something for @jonaslagoni to take a look at |
Hmm I was able to replicate the issue with this commit, however while experimenting with it I realised that the issue is triggered by a missing I was surprised that none of the tooling told me about this, but apparently a schema without a See this issue for more details. Let's close this with lesson learned: don't forget the |
Perhaps something for the parser to alert us about @jonaslagoni ? |
Describe the bug
I have some shared fields that are used in multiple messages in my schema:
When these are included into my message...
then the generated code does not constrain the fields correctly:
If I comment out the
deviceId
field, then thecapturedAt
field is represented correctly as anOffsetDateTime
:How to Reproduce
Please see this Codesandbox or gist.
Expected behavior
I expect that fields will be constrained according to their
format
, rather than a single field's constraints being applied to every field of that type regardless of theformat
option. I was attempting to usetypeMapping
to set custom types for these fields when I noticed this issue:The text was updated successfully, but these errors were encountered: