openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[REQ] Schema preprocessor wanted

Open bme-cgm opened this issue 10 months ago • 3 comments

Is your feature request related to a problem? Please describe.

My problem is that I am using a schema file (occasionally updated) and there is a double that should be a decimal. I would like to preprocess the schema file to ensure this fix is always present.

Describe the solution you'd like

There are several ways to offer such a preprocessor. One way could be to allow the use of the Overlay Specification, but I don't know if it is finished yet: https://github.com/OAI/Overlay-Specification

I would like for the preprocessor step not create a new file, but make an on-the-fly transformation of the schema file, with optional debug output.

Describe alternatives you've considered

Adding a README file specifying that the schema file must be manually fixed.

bme-cgm avatar Jan 20 '26 16:01 bme-cgm

Hi, this functionality already exists by using the functionality introduced in https://github.com/OpenAPITools/openapi-generator/pull/20995.

Mattias-Sehlstedt avatar Jan 20 '26 18:01 Mattias-Sehlstedt

I see. The documentation unfortunately doesn't explain to me well enough how do do this. Also, as I am using OpenAPI Generator via the REST API Client Code Generator extension for visual studio, I need to be able to do this using the config file.

The schema file can be downloaded from here:

https://apis.e-conomic.com/#Journals

And I need the format attribute to be change from double to decimal, in the entries found using this string search (two hits):

"amount": {

If this is possible using the normalizer, I could use some help doing that. I don't know if this is where I can query for assistance, though.

bme-cgm avatar Jan 21 '26 08:01 bme-cgm

I have never used the Client Code Generator extension so I am not knowledgeable of what it offers.

Given that this normalizer-injection is a quite new and niche functionality I would not be surprised if it is not supported. But I leave it to someone else to investigate and answer.

Mattias-Sehlstedt avatar Jan 22 '26 21:01 Mattias-Sehlstedt