Skip to content

fix: async schema deserializer "additionalProperties" not deserializing JsonSchema correctly#120

Merged
VisualBean merged 2 commits intomainfrom
ulrik/additional_properties
Jul 11, 2023
Merged

fix: async schema deserializer "additionalProperties" not deserializing JsonSchema correctly#120
VisualBean merged 2 commits intomainfrom
ulrik/additional_properties

Conversation

@UlrikSandberg
Copy link
Collaborator

About the PR

Additional properties field of the async spec were experiencing a bug. Having the "additionalProperties" present caused the library to throw an Error as the MapNode didn't implement GetBooleanValueOrDefault and the code thus defaulted to the abstract ParseNode implementation which throw an exception.

This PR tries to cast the node to a ValueNode before calling GetBooleanValueOrDefault else the already existing behaviour.

Unit test to accommodate the change.

Changelog

  • Add: Fixed bug causing additionalProperties to cause an Error.
  • Remove: Removed bug causing additionalProperties to cause an Error.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you UlrikSandberg for your first pull request to AsyncAPI.NET repository. Please check out our contributors guide.

@UlrikSandberg UlrikSandberg changed the title Async schema deserializer "additonal properties" bug fixed. fix: async schema deserializer "additonal properties" bug fixed. Jul 11, 2023
@VisualBean VisualBean changed the title fix: async schema deserializer "additonal properties" bug fixed. fix: async schema deserializer "additional properties" bug fixed. Jul 11, 2023
@VisualBean VisualBean changed the title fix: async schema deserializer "additional properties" bug fixed. fix: async schema deserializer "additionalProperties" not deserializing JsonSchema correctly Jul 11, 2023
@VisualBean VisualBean merged commit 3761f52 into main Jul 11, 2023
@VisualBean VisualBean deleted the ulrik/additional_properties branch July 11, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments