ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 64 forks source link

Generate constraint annotation for fields with nullable enable in OAS 3.1.0 version #6643

Open lnash94 opened 5 months ago

lnash94 commented 5 months ago

Description: If the OAS object property has this field with constraint

"url": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 512,
              "format": "uri"
            },

Currently, code generation adds annotations for the given field which causes a compilation error. Solution: Avoid generating annotations for the given field since the ballerina can not support constraints for union types.