Bug Report Checklist
Description
RustClientCodegen.fromModel names an inline oneOf member from its title, falling back to its type. A member with neither, such as allOf with a single $ref plus required, gets toModelName(null), and generation stops with a NullPointerException. GitHub's current REST description hits this on actions-policy-repo-conditions, so the rust generator can't produce a client for it.
The frame is the same as #21192, but that issue's own repro (a 3.1 anyOf with type: "null") generates fine on 7.25.0. This is a different trigger reaching the same line.
openapi-generator version
7.25.0, and master at 10e6c21.
OpenAPI declaration file content or url
openapi: 3.0.3
info:
title: oneOf member without a type
version: "1"
paths:
/conditions:
get:
operationId: getConditions
responses:
"200":
description: ok
content:
application/json:
schema:
$ref: "#/components/schemas/Conditions"
components:
schemas:
Conditions:
type: object
oneOf:
- type: object
maxProperties: 0
- allOf:
- $ref: "#/components/schemas/WorkflowPathCondition"
required:
- workflow_path
maxProperties: 1
WorkflowPathCondition:
type: object
properties:
workflow_path:
type: string
Generation Details
java -jar openapi-generator-cli-7.25.0.jar generate -g rust -i spec.yaml -o out
Steps to reproduce
Exception in thread "main" java.lang.RuntimeException: Could not process model 'Conditions'.Please make sure that your schema is correct!
Caused by: java.lang.NullPointerException: Cannot invoke "String.replaceAll(String, String)" because "name" is null
at org.openapitools.codegen.languages.AbstractRustCodegen.sanitizeIdentifier(AbstractRustCodegen.java:189)
at org.openapitools.codegen.languages.AbstractRustCodegen.toModelName(AbstractRustCodegen.java:355)
at org.openapitools.codegen.languages.RustClientCodegen.fromModel(RustClientCodegen.java:324)
Expected: a variant named after the member's base type, WorkflowPathCondition(Box<models::WorkflowPathCondition>).
Related issues/PRs
#21192 (same NullPointerException site).
Bug Report Checklist
Description
RustClientCodegen.fromModelnames an inlineoneOfmember from itstitle, falling back to itstype. A member with neither, such asallOfwith a single$refplusrequired, getstoModelName(null), and generation stops with a NullPointerException. GitHub's current REST description hits this onactions-policy-repo-conditions, so the rust generator can't produce a client for it.The frame is the same as #21192, but that issue's own repro (a 3.1
anyOfwithtype: "null") generates fine on 7.25.0. This is a different trigger reaching the same line.openapi-generator version
7.25.0, and master at 10e6c21.
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Expected: a variant named after the member's base type,
WorkflowPathCondition(Box<models::WorkflowPathCondition>).Related issues/PRs
#21192 (same NullPointerException site).