OpenAPITools / OpenAPITools/openapi-generator
[BUG][Asciidoc] converter replaces underscore with CamelCase
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- What's the version of OpenAPI Generator used? 4.2.1
- Have you search for related issues/PRs?
Description
When a component schema contains a _ in the name, this is replaced with a camel cased version.
Unfortunately this is not consistent and most anchors are rendered correctly but therefore don't follow the reference since the target does not contain the underscore
openapi-generator version
4.2.1
OpenAPI declaration file content or url
openapi: 3.0.1
info:
title: Swagger Petstore
version: "1.0.0"
paths:
/pet/{petId}:
get:
tags:
- pet
summary: Find pet by ID
description: Returns a single pet
operationId: getPetById
parameters:
- name: petId
in: path
description: ID of pet to return
required: true
schema:
type: integer
format: int64
responses:
200:
description: successful operation
content:
application/xml:
schema:
$ref: '#/components/schemas/My_Pet'
application/json:
schema:
$ref: '#/components/schemas/My_Pet'
components:
schemas:
Main_Category:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
xml:
name: Main_Category
My_Pet:
type: object
properties:
id:
type: integer
format: int64
category:
$ref: '#/components/schemas/Main_Category'
xml:
name: My_Pet
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied OpenAPI declaration and the Asciidoc converter's handling of schema names, anchors, and references. Reproduce the issue with the Main_Category and My_Pet schemas, then trace where underscores are transformed. Done means generated anchors and references consistently preserve or resolve the schema names.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- documentation, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100