-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File Path Issue on Windows with OAS 3.1 - Illegal character in opaque part at index #2136
Comments
I'm experiencing this same issue with the file path having the wrong slashes |
I had the same issue in the same context as @gexclaude (same stack trace). So you probably parse an openapi file with internal references like this : schema:
$ref: '#/components/schemas/Departement' When the parser has to resolve relative location in So, in my context, I changed the <!-- path after ${project.baseUri} depends of the location of your openapi.yaml file and wether it is packaged or not at build -->
<inputSpec>${project.baseUri}/target/openapi.yaml</inputSpec> Hope this helps |
My team hit the same issue, and moving to ${project.baseUri} corrects this specific error that we see on Windows machines. However, when we make that change to the input spec reference in pom.xml, the java classes generated using the same input spec file are now different When using project.baseUri to reference the location of the spec, the output from the openapi generator now includes classes generated with the 'inner' postfix that duplicate the actual underlying class. This then breaks all of the interface contracts on the consumer side. |
as described in swagger-api/swagger-parser#2136 (comment) , openapi-generator generates class names with Inner suffix when inputSpec set to ${project.baseUri}... cf. https://openapi-generator.tech/docs/customization/#inline-schema-naming to configure generator
@shavemi I observed too the issue with some classes generated with the inner prefix. In my case, classes which map As an example, if you consider the following openapi piece of spec : components:
schemas:
DepartementListeProjetesAvecChefLieu:
description: 'Liste des départements projetés'
type: array
xml:
wrapped: true
name: ListeDepartementsProjetes
items:
$ref: '#/components/schemas/TerritoireBase_ChefLieu' where If I changed the config of openapi generator maven plugin adding inside <inlineSchemaNameMappings>DepartementListeProjetesAvecChefLieu_inner=TerritoireBase_ChefLieu</inlineSchemaNameMappings> after generating, there is no more class |
We also encountered the same problem.
means Detail codes can see How to reproduce: Change will resolve this bug. |
We encountered the issue here, when using OpenAPITools Generator (Maven Plugin) after we switched from OAS 3.0.3 to 3.1.0:
OpenAPITools/openapi-generator#18161
As the Issue on OpenAPITools indicates, the error might be in the swagger-parser. At least we see in the stacktrace, that the error happens there. Is this a known issue?
Our full stack trace.
The text was updated successfully, but these errors were encountered: