You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Try to generate the client for the following spec:
openapi: 3.0.0info:
title: Albums APIversion: 1.0.0description: A simple API to get a list of albumspaths:
/albums:
get:
summary: Get a list of albumsresponses:
'200':
description: A list of albumscontent:
application/json:
schema:
$ref: '#/components/schemas/AlbumArray'/albums/{id}:
get:
summary: Get an album by IDparameters:
- name: idin: pathrequired: trueschema:
type: integerresponses:
'200':
description: An albumcontent:
application/json:
schema:
$ref: '#/components/schemas/AlbumArray/items'components:
schemas:
AlbumArray:
type: arrayitems:
type: objectproperties:
id:
type: integerexample: 1title:
type: stringexample: Album Titleartist:
type: stringexample: Artist Namerelease_date:
type: stringformat: dateexample: '2023-01-01'
$ bal openapi -i openapi.yaml --mode client --single-fileballerina: Oh no, something really went wrong. Bad. Sad.We appreciate it if you can report the code that broke Ballerina inhttps://github.com/ballerina-platform/ballerina-lang/issues with thelog you get below and your sample code.We thank you for helping make us better.[2024-10-30 11:37:34,774] SEVERE {b7a.log.crash} - Cannot invoke "io.swagger.v3.oas.models.media.Schema.get$ref()" because "schemaValue" is null java.lang.NullPointerException: Cannot invoke "io.swagger.v3.oas.models.media.Schema.get$ref()" because "schemaValue" is null at io.ballerina.openapi.core.generators.type.TypeGeneratorUtils.getTypeGenerator(TypeGeneratorUtils.java:67) at io.ballerina.openapi.core.generators.type.BallerinaTypesGenerator.generateTypeDescriptorNodeForOASSchema(BallerinaTypesGenerator.java:122) at io.ballerina.openapi.core.generators.type.BallerinaTypesGenerator.generateTypeDescriptorNodeForOASSchema(BallerinaTypesGenerator.java:88) at io.ballerina.openapi.core.generators.common.TypeHandler.getTypeNodeFromOASSchema(TypeHandler.java:196) at io.ballerina.openapi.core.generators.common.TypeHandler.getTypeNodeFromOASSchema(TypeHandler.java:191) at io.ballerina.openapi.core.generators.client.FunctionReturnTypeGeneratorImp.getDataType(FunctionReturnTypeGeneratorImp.java:188) at io.ballerina.openapi.core.generators.client.FunctionReturnTypeGeneratorImp.populateReturnType(FunctionReturnTypeGeneratorImp.java:135) at io.ballerina.openapi.core.generators.client.FunctionReturnTypeGeneratorImp.getReturnTypeInfo(FunctionReturnTypeGeneratorImp.java:113) at io.ballerina.openapi.core.generators.client.FunctionReturnTypeGeneratorImp.getReturnType(FunctionReturnTypeGeneratorImp.java:81) at io.ballerina.openapi.core.generators.client.ResourceFunctionSignatureGenerator.generateFunctionSignature(ResourceFunctionSignatureGenerator.java:86) at io.ballerina.openapi.core.generators.client.ResourceFunctionGenerator.generateFunction(ResourceFunctionGenerator.java:88) at io.ballerina.openapi.core.generators.client.BallerinaClientGenerator.addResourceFunction(BallerinaClientGenerator.java:653) at io.ballerina.openapi.core.generators.client.BallerinaClientGenerator.createResourceFunctions(BallerinaClientGenerator.java:643) at io.ballerina.openapi.core.generators.client.BallerinaClientGenerator.getClassDefinitionNode(BallerinaClientGenerator.java:260) at io.ballerina.openapi.core.generators.client.BallerinaClientGenerator.getModuleMemberDeclarationNodes(BallerinaClientGenerator.java:216) at io.ballerina.openapi.core.generators.client.BallerinaClientGenerator.getSyntaxTree(BallerinaClientGenerator.java:194) at io.ballerina.openapi.core.generators.client.BallerinaClientGenerator.generateSyntaxTree(BallerinaClientGenerator.java:188) at io.ballerina.openapi.cmd.BallerinaCodeGenerator.generateClientFiles(BallerinaCodeGenerator.java:428) at io.ballerina.openapi.cmd.BallerinaCodeGenerator.generateClient(BallerinaCodeGenerator.java:257) at io.ballerina.openapi.cmd.OpenApiCmd.generatesClientFile(OpenApiCmd.java:445) at io.ballerina.openapi.cmd.OpenApiCmd.openApiToBallerina(OpenApiCmd.java:368) at io.ballerina.openapi.cmd.OpenApiCmd.execute(OpenApiCmd.java:267) at java.base/java.util.Optional.ifPresent(Optional.java:178) at io.ballerina.cli.launcher.Main.main(Main.java:59)
Version
Ballerina SwanLake Update 10(2201.10.x)
Environment Details (with versions)
No response
The text was updated successfully, but these errors were encountered:
Description
Steps to Reproduce
Try to generate the client for the following spec:
Version
Ballerina SwanLake Update 10(2201.10.x)
Environment Details (with versions)
No response
The text was updated successfully, but these errors were encountered: