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
Hey there! I just started using this tool as a means to replace usage of the openapi-generator jax-rs server stub generator. This is necessary because I'd like my REST resources to be reactive. Unfortunately, I encountered an issue with generating the reactive interfaces that is hard to troubleshoot. The following contains, the OpenAPI spec in question, the properties set in my pom.xml , and the PROJECT_GENERATION_FAILED.txt output.
OpenAPI spec:
openapi: 3.0.3info:
contact:
email: [email protected]name: Anon url: 'https://anon.com'description: |- API for managing inventory sources and related metadata. Inventory is comprised of a collection of sources, which are used to generate a list of instances.title: Inventoryversion: '1.0'termsOfService: 'https://anon.com/legal'servers:
- url: 'http://localhost:9996/api/inventory'tags:
- name: Inventorypaths:
'/v1/{org_id}/sources':
parameters:
- $ref: '#/components/parameters/OrgIdPathParam'get:
summary: Get sourcesoperationId: list-sourcesresponses:
'200':
$ref: '#/components/responses/Sources'description: Return a list of all sources.tags:
- Inventorysecurity:
- Auth0: []'/v1/{org_id}/sources/gcp':
parameters:
- $ref: '#/components/parameters/OrgIdPathParam'post:
summary: Create or update sourceoperationId: create-gcp-sourceresponses:
'200':
description: OKheaders: {}content:
application/json:
schema:
$ref: '#/components/schemas/Source'description: 'Create or update the source identified by a unique ID in the body, parsed by its source type (currently only accepts a service account key for GCP).'requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateGCPSourceRequest'description: Upload JSON source credentials.parameters: []tags:
- Inventorysecurity:
- Auth0: []'/v1/{org_id}/sources/gcp/{source_id}':
parameters:
- $ref: '#/components/parameters/OrgIdPathParam'
- $ref: '#/components/parameters/SourceIdPathParam'put:
summary: Put GCP SourceoperationId: put-gcp-sourceresponses:
'200':
description: OKcontent:
application/json:
schema:
$ref: '#/components/schemas/Source'requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateGCPSourceRequest'tags:
- Inventory'/v1/{org_id}/sources/{source_id}':
parameters:
- $ref: '#/components/parameters/OrgIdPathParam'
- $ref: '#/components/parameters/SourceIdPathParam'delete:
summary: Delete sourceoperationId: delete-sourceresponses:
'204':
description: No Content'404':
description: Not Foundtags:
- Inventorysecurity:
- Auth0: []get:
summary: Get SourceoperationId: getSourceresponses:
'200':
description: OKcontent:
application/json:
schema:
$ref: '#/components/schemas/Source'security:
- Auth0: []tags:
- Inventory'/v1/{org_id}/sources/{source_id}:sync':
post:
operationId: sync-sourceresponses:
'200':
description: OK'404':
description: Not Foundsummary: Sync a sourcetags:
- Inventorydescription: Synchronize available instances from the given source.security:
- Auth0: []parameters:
- $ref: '#/components/parameters/OrgIdPathParam'
- $ref: '#/components/parameters/SourceIdPathParam''/v1/{org_id}/search':
parameters:
- $ref: '#/components/parameters/OrgIdPathParam'post:
summary: Search instancesoperationId: search-instancesdescription: Search for instances based on a set of filters. Supports pagination based on instance ID cursor. Results are ordered by creation timestamp.parameters:
- $ref: '#/components/parameters/PageOffsetQueryParam'
- $ref: '#/components/parameters/PageSizeQueryParam'requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedSearchInstancesRequest'examples:
match all:
value:
filters: []description: Filter criteria.tags:
- Inventoryresponses:
'200':
description: OKcontent:
application/json:
schema:
$ref: '#/components/schemas/PaginatedSearchInstancesResponse''400':
description: Bad Requestsecurity:
- Auth0: []'/v1/{org_id}/instance/{instance_id}':
parameters:
- $ref: '#/components/parameters/OrgIdPathParam'
- $ref: '#/components/parameters/InstanceIdPathParam'get:
summary: Get instance detailsresponses:
'200':
description: OKcontent:
application/json:
schema:
$ref: '#/components/schemas/Instance'operationId: get-instancedescription: Get instance details.tags:
- Inventorysecurity:
- Auth0: []'/v1/{org_id}/instances/count':
parameters:
- schema:
type: stringname: org_idin: pathrequired: trueget:
summary: Get Org Instance Counttags:
- Inventoryresponses:
'200':
description: OKcontent:
application/json:
schema:
type: integerformat: int64operationId: get-org-instance-countdescription: Get the total number of instances in an organizationsecurity:
- Auth0: []components:
parameters:
OrgIdPathParam:
name: org_idin: pathrequired: trueschema:
type: stringdescription: The tenant ID the resource belongs toPageOffsetQueryParam:
name: page_offsetin: queryrequired: falseschema:
type: integerdescription: Token for the next pagePageSizeQueryParam:
name: page_sizein: queryrequired: falseschema:
type: integerdescription: Page sizeSourceIdPathParam:
name: source_idin: pathrequired: trueschema:
type: stringformat: uuiddescription: id of the sourceInstanceIdPathParam:
name: instance_idin: pathrequired: trueschema:
type: stringformat: uuiddescription: ID of the instance to retrieverequestBodies: {}schemas:
Source:
title: ''type: objectproperties:
id:
type: stringname:
type: stringlast_synced:
type: integerformat: int64instance_count:
type: integercredentials_id:
type: stringformat: uuidtype:
$ref: '#/components/schemas/SourceType'required:
- id
- name
- last_synced
- instance_count
- credentials_id
- typeSearchFilter:
title: ''type: objectproperties:
key:
type: stringoperator:
type: stringenum:
- lt
- eq
- gt
- contains
- not_containsvalue:
type: stringtype:
type: stringenum:
- GCP_METADATA
- FACTS
- SOURCE
- ASSIGNED_POLICY
- NODErequired:
- key
- operator
- value
- typeCuratedInstance:
description: ''type: objecttitle: ''properties:
name:
type: stringid:
type: stringsource:
$ref: '#/components/schemas/Source'creation_time:
type: integerformat: int64internal_ip:
type: stringexternal_ip:
type: stringoperating_system:
type: stringmachine_type:
type: stringnode_status:
type: stringuptime:
type: integerformat: int64zone:
type: stringrequired:
- name
- id
- source
- creation_time
- internal_ip
- external_ip
- operating_system
- machine_type
- node_status
- uptime
- zoneInstance:
title: ''type: objectproperties:
name:
type: stringsource:
$ref: '#/components/schemas/Source'facts:
type: objectmetadata:
type: objectrequired:
- name
- source
- facts
- metadataGCPServiceAccount:
title: GCPServiceAccounttype: objectproperties:
id:
type: stringformat: uuidtype:
type: stringproject_id:
type: stringprivate_key_id:
type: stringprivate_key:
type: stringclient_email:
type: stringclient_id:
type: stringauth_uri:
type: stringtoken_uri:
type: stringauth_provider_x509_cert_url:
type: stringclient_x509_cert_url:
type: stringrequired:
- id
- type
- project_id
- private_key_id
- private_key
- client_email
- client_id
- auth_uri
- token_uri
- auth_provider_x509_cert_url
- client_x509_cert_urlCreateGCPSourceRequest:
title: CreateGCPSourceRequesttype: objectproperties:
name:
type: stringgather_facts_on_ingest:
type: booleandefault: truecredentials:
$ref: '#/components/schemas/GCPCredential'required:
- name
- gather_facts_on_ingest
- credentialsPatchGCPSourceRequest:
title: PatchGCPSourceRequesttype: objectproperties:
name:
type: stringgather_facts_on_ingest:
type: booleanPaginatedSearchInstancesRequest:
title: PaginatedSearchInstancesRequesttype: objectproperties:
filters:
type: arrayitems:
$ref: '#/components/schemas/SearchFilter'PaginatedSearchInstancesResponse:
title: PaginatedSearchInstancesResponsetype: objectproperties:
next_page_offset:
type: integerinstances:
type: arrayitems:
$ref: '#/components/schemas/CuratedInstance'total_count:
type: integerformat: int64required:
- next_page_offset
- instances
- total_countGCPCredential:
title: GCPCredentialtype: objectproperties:
type:
type: stringproject_id:
type: stringprivate_key_id:
type: stringprivate_key:
type: stringclient_email:
type: stringclient_id:
type: stringauth_uri:
type: stringtoken_uri:
type: stringauth_provider_x509_cert_url:
type: stringclient_x509_cert_url:
type: stringrequired:
- type
- project_id
- private_key_id
- private_key
- client_email
- client_id
- auth_uri
- token_uri
- auth_provider_x509_cert_url
- client_x509_cert_urlSourceType:
type: stringtitle: SourceTypeenum:
- GCPresponses:
Sources:
description: A list of sourcescontent:
application/json:
schema:
type: arrayitems:
$ref: '#/components/schemas/Source'Search:
description: 'A list of curated instance details matching the search criteria, with a next cursor if there are more results.'content:
application/json:
schema:
type: objectproperties:
next_cursor:
type: stringinstances:
type: arrayitems:
$ref: '#/components/schemas/CuratedInstance'required:
- instancessecuritySchemes:
Auth0:
type: httpscheme: bearerbearerFormat: jwtdescription: Auth0 token
quarkus-openapi-generator version: 3.0.0-snapshot built from main
Error:
An unexpected server error was encountered while generating the project. See
the details of the error below.
Generation Log:
Generating Bean: com.anon.web.api.beans.Source
Generating Bean: com.anon.web.api.beans.SearchFilter
Generating Bean: com.anon.web.api.beans.CuratedInstance
Generating Bean: com.anon.web.api.beans.Instance
Generating Bean: com.anon.web.api.beans.GCPServiceAccount
Generating Bean: com.anon.web.api.beans.CreateGCPSourceRequest
Generating Bean: com.anon.web.api.beans.PatchGCPSourceRequest
Generating Bean: com.anon.web.api.beans.PaginatedSearchInstancesRequest
Generating Bean: com.anon.web.api.beans.PaginatedSearchInstancesResponse
Generating Bean: com.anon.web.api.beans.GCPCredential
Generating Bean: com.anon.web.api.beans.SourceType
Adding to zip: com/anon/web/api/beans/Source.java
Adding to zip: com/anon/web/api/beans/PaginatedSearchInstancesRequest.java
Adding to zip: com/anon/web/api/beans/Facts.java
Adding to zip: com/anon/web/api/beans/CreateGCPSourceRequest.java
Adding to zip: com/anon/web/api/beans/SourceType.java
Adding to zip: com/anon/web/api/beans/PatchGCPSourceRequest.java
Adding to zip: com/anon/web/api/beans/Metadata.java
Adding to zip: com/anon/web/api/beans/CuratedInstance.java
Adding to zip: com/anon/web/api/beans/PaginatedSearchInstancesResponse.java
Adding to zip: com/anon/web/api/beans/Instance.java
Adding to zip: com/anon/web/api/beans/GCPCredential.java
Adding to zip: com/anon/web/api/beans/SearchFilter.java
Adding to zip: com/anon/web/api/beans/GCPServiceAccount.java
Generating Interface: com.anon.web.api.V1Resource
Server Stack Trace:
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.base/java.util.Objects.checkIndex(Objects.java:361)
at java.base/java.util.ArrayList.get(ArrayList.java:427)
at java.base/java.util.Collections$UnmodifiableList.get(Collections.java:1347)
at io.apicurio.hub.api.codegen.OpenApi2JaxRs.lambda$parseType$15(OpenApi2JaxRs.java:657)
at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1220)
at io.apicurio.hub.api.codegen.OpenApi2JaxRs.parseType(OpenApi2JaxRs.java:654)
at io.apicurio.hub.api.codegen.OpenApi2JaxRs.generateReactiveTypeName(OpenApi2JaxRs.java:769)
at io.apicurio.hub.api.codegen.OpenApi2JaxRs.lambda$generateJavaInterface$9(OpenApi2JaxRs.java:560)
at java.base/java.util.Optional.map(Optional.java:260)
at io.apicurio.hub.api.codegen.OpenApi2JaxRs.lambda$generateJavaInterface$14(OpenApi2JaxRs.java:560)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at io.apicurio.hub.api.codegen.OpenApi2JaxRs.generateJavaInterface(OpenApi2JaxRs.java:519)
at io.apicurio.hub.api.codegen.OpenApi2JaxRs.generateJavaInterface(OpenApi2JaxRs.java:634)
at io.apicurio.hub.api.codegen.OpenApi2JaxRs.generateAll(OpenApi2JaxRs.java:322)
at io.apicurio.hub.api.codegen.OpenApi2JaxRs.generate(OpenApi2JaxRs.java:216)
at io.quarkiverse.openapi.server.generator.deployment.codegen.ApicurioCodegenWrapper.generate(ApicurioCodegenWrapper.java:69)
at io.quarkiverse.openapi.server.generator.deployment.codegen.ApicurioOpenApiServerCodegen.trigger(ApicurioOpenApiServerCodegen.java:87)
at io.quarkus.deployment.CodeGenerator.lambda$trigger$4(CodeGenerator.java:206)
at io.quarkus.deployment.CodeGenerator.callWithClassloader(CodeGenerator.java:181)
at io.quarkus.deployment.CodeGenerator.trigger(CodeGenerator.java:203)
at io.quarkus.deployment.CodeGenerator.initAndRun(CodeGenerator.java:80)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at io.quarkus.maven.GenerateCodeMojo.generateCode(GenerateCodeMojo.java:88)
at io.quarkus.maven.GenerateCodeMojo.doExecute(GenerateCodeMojo.java:54)
at io.quarkus.maven.QuarkusBootstrapMojo.execute(QuarkusBootstrapMojo.java:171)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:903)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:280)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:203)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:255)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:201)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:361)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:314)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at org.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:52)
at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:161)
at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:73)
The text was updated successfully, but these errors were encountered:
Hey there! I just started using this tool as a means to replace usage of the openapi-generator jax-rs server stub generator. This is necessary because I'd like my REST resources to be reactive. Unfortunately, I encountered an issue with generating the reactive interfaces that is hard to troubleshoot. The following contains, the OpenAPI spec in question, the properties set in my
pom.xml
, and thePROJECT_GENERATION_FAILED.txt
output.OpenAPI spec:
My pom.xml properties:
quarkus-openapi-generator version: 3.0.0-snapshot built from main
Error:
The text was updated successfully, but these errors were encountered: