-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Custom deserializer shouldn't instantiate their own ObjectMapper #128
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. |
Can you tell me more about #131 (comment)? You crafted schema by hands or by objectMapper? upd: On deserialization: {
"description": "Id of the user.",
"schema": {
"type": "string"
},
"location": "$message.payload#/user/id",
"x-ep-event-api-product-version-id": "4ndau725iz0",
"x-ep-event-api-id": "jcc06dwq1bh",
"x-ep-event-api-product-version": "0.1.0",
"x-ep-state-name": "RELEASED",
"x-ep-application-domain-id": "4auuz4amd31",
"x-ep-event-api-product-id": "tcpugx95gc0",
"x-ep-event-api-version-id": "t8hkbn8lit9",
"x-ep-application-domain-name": "gravitee_demo",
"x-ep-event-api-version": "0.1.0",
"x-ep-event-api-product-name": "User Event Api Product",
"x-ep-state-id": "2"
} On serialization:
Here is only one type in value - String instead of Object |
My comment regarding extensionFields is not related to this PR, but it is due to a change made with aec9541a4a469b1b62dd58f3728203f41e755957 the extra extensionFields get written back when you serialized the model. I tested by reading AsyncAPI from file to model with x-xxx attributes which creates extra extensionFields maps, then I write it back and the result is the one I attached above. |
Great, looks like everything works as expected. Will close this issue tomorrow upd: |
Yes that is exactly the meaning of my comment. The field got generated when I serialized the model to the file and it shouldn’t. |
I'm a little bit confused, is here unexpected behavior or not😅 If you think that yes, tell how to reproduce. I checked once more, on reading of spec with 'x-*' fields, they have been moved to 'extensionFuelds', on writing they have been put to object body directly |
I will check it again, let you know. |
Check on new develop. I merged changes - #133 |
Describe the bug
While trying to deserialize AsyncAPI with a custom object mapper which disables FAIL_ON_UNKNOWN_PROPERTIES, stack exceptions are logged anyway and if any extensions are present under Component, Schema, or Message the result AsyncAPI object is half empty.
I will try to work on a PR.
How to Reproduce
Steps to reproduce the issue. Attach all resources that can help us understand the issue:
Expected behavior
All ignore properties (x-*) are ignored.
The text was updated successfully, but these errors were encountered: