|
Post by dchanman on Oct 3, 2019 18:39:30 GMT
Hi everyone, Does anyone have any recommendations or experiences with autogenerating API wrappers based off the Redfish Schema? We're currently creating a Redfish client in C++ and we wanted some library which could perform strongly-typed parsing of the resource attributes. For example, libredfish has implemented this in C for Chassis: github.com/DMTF/libredfish/blob/master/src/entities/chassis.cWe're looking for something which can provide the same sort of API for most other common Redfish resources (e.g. System, Assembly, Drive, etc). Since the Redfish schema is in various structured data formats (csdl, json-schema, openapi), I would assume that there would be some tooling available which can automatically generate these APIs though. I'm not sure exactly where to start looking. Has anyone else needed to solve a similar problem?
|
|
|
Post by mraineri on Oct 8, 2019 14:38:26 GMT
The OpenAPI community should be solving this, which is why Redfish extended definitions into the OpenAPI space as of spec version 1.6.0. OpenAPI offers tooling to help automatically generate client-side code and documentation. The "Swagger Codegen" tool does list C++ as one of the supported output languages, but I'm not sure what the current state of the tool is with regards to C++ currently. We've had some successes with running the tool against the Redfish schemas in the OpenAPI format, but nothing that has completed error free so far. There seems to be more work to be done in the OpenAPI community with regards to how the spec is evolving, and some of that might drive back into Redfish for how we generate our schemas. Redfish is certainly a very complex example of OpenAPI, so I can imagine we're currently taking certain aspects of it further than envisioned. We have some information here with how one particular user has used Swagger Codegen to create a Go client: github.com/DMTF/Redfish-Tools/issues/179 . I'd really like to hear from others about their successes/issues and see if there's anything we can do in Redfish to better accommodate OpenAPI.
|
|