AmateurECE / redfish-codegen

Implementation of DMTF's Redfish data models, generated from their OpenAPI documents.
Apache License 2.0
4 stars 2 forks source link

Duplicate Schemas with swagger-parser v1.18.0 #3

Open AmateurECE opened 7 months ago

AmateurECE commented 7 months ago

Unfortunately, there seems to be a defect in swagger-parser v1.18.0 that causes duplicate schemas to be generated when there are circular references between OpenAPI specification files. This manifests in the output of redfish-generator:

[main] WARN com.twardyece.dmtf.specification.OpenapiSpecification - Duplicate schema AccountService_v1_13_0_MFABypass_1 encountered while parsing AccountService.v1_13_0.yaml
...
[main] WARN com.twardyece.dmtf.specification.OpenapiSpecification - Duplicate schema StorageControllerMetrics_v1_0_0_NVMeSMARTMetrics_1 encountered while parsing StorageControllerMetrics.v1_0_0.yaml

I've opened swagger-api/swagger-parser#1961 to capture this issue, and am working on a pull request to remedy. I would much prefer to fix this issue before the next release of the redfish-codegen crates, so that we can be on a fixed version of swagger-parser again, but I am willing to entertain releasing the software with these duplicated models if there is an appetite for a sooner release, since the duplicate models do not seem to produce build errors.

AmateurECE commented 3 months ago

Since there's been no movement on swagger-api/swagger-parser#1961, I've decided to begin re-implementing the generator not to have this dependency. I'll track the progress of that work in #4, and leave this issue open until it is resolved.