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

Add nullable support #55

Merged
merged 4 commits into from
Oct 6, 2022

Conversation

RolandHewage
Copy link
Contributor

Purpose

The AsyncAPI schema doesn't support nullable anymore. The idea is that OpenAPI and AsyncAPI will converge into standard JSON Schema in upcoming releases. Please refer [1], [2], [3]. But there are scenarios where the schema fields can be nullable which results in Ballerina data binding issues. Therefore it was decided to give nullable support in the AsyncAPI tool using the x-nullable: true extension in AsyncAPI schema. Refer email thread "[Discussion] Improve AsyncAPI tool to support nullable fields in AsyncAPI schema".

[1] asyncapi/spec#204 (comment)
[2] asyncapi/generator#33
[3] https://www.asyncapi.com/docs/reference/specification/v2.0.0#schemaObject

 x-nullable: true

Resolves https://github.com/wso2-enterprise/choreo/issues/13846

Goals

Add nullable support

Approach

Add nullable support in schema generation

User stories

Support scenarios where nullable fields are present in AsyncAPI schema

Release note

Add nullable support

Automation tests

  • Unit tests

    Done

  • Integration tests

    Done

Security checks

Test environment

Ballerina Version: 2201.1.0
Operating System: Ubuntu 20.04
Java SDK: 11

@codecov
Copy link

codecov bot commented Jun 30, 2022

Codecov Report

Base: 0.00% // Head: 0.00% // No change to project coverage 👍

Coverage data is based on head (50b49d6) compared to base (decad01).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@          Coverage Diff          @@
##            main     #55   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         27      28    +1     
  Lines        851     947   +96     
  Branches      72      85   +13     
=====================================
- Misses       851     947   +96     
Impacted Files Coverage Δ
...ncapi/codegenerator/application/CodeGenerator.java 0.00% <0.00%> (ø)
...syncapi/codegenerator/configuration/Constants.java 0.00% <ø> (ø)
...degenerator/controller/AsyncApiSpecController.java 0.00% <0.00%> (ø)
...codegenerator/controller/DispatcherController.java 0.00% <0.00%> (ø)
...nerator/usecase/ExtractIdentifierPathFromSpec.java 0.00% <0.00%> (ø)
...nerator/usecase/ExtractIdentifierTypeFromSpec.java 0.00% <0.00%> (ø)
...r/usecase/GenerateModuleMemberDeclarationNode.java 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions
Copy link

github-actions bot commented Aug 4, 2022

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions
Copy link

github-actions bot commented Sep 6, 2022

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@Drifftr Drifftr merged commit 89eb7a9 into ballerina-platform:main Oct 6, 2022
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.

2 participants