|
Post by dyutiman on Dec 6, 2019 12:09:16 GMT
Hi, What I am trying to do is to dynamically generate Java classes from the schema files. For that I am using jsonschema2pojo library. In the process one issue I hit with the properties referenced by a schema with remote url. For example, in the ComputerSystem schema the Memory property is referenced by redfish.dmtf.org/schemas/v1/MemoryCollection.json#/definitions/MemoryCollection. "Memory": { "$ref": "http://redfish.dmtf.org/schemas/v1/MemoryCollection.json#/definitions/MemoryCollection", "description": "The link to the collection of memory associated with this system.", "longDescription": "This property shall contain a link to a Resource Collection of type MemoryCollection.", "readonly": true, "versionAdded": "v1_1_0" } If I am seating in a network which does not have outbound connection, then the tool will not be able to use the external reference. And hence the property type in my Java class will be the plain java.lang.Object. This is not desirable as, those properties should have the proper type. For example in this case the Memory property should be the MemoryCollection object type. I just wanted to check if there is any particular reason for which some of these properties are referenced by external URLs! Or is there any other way to work around on this issue! Those properties with local references are coming up perfectly fine. - thanks
|
|
|
Post by jautor on Dec 6, 2019 18:11:49 GMT
There are external references throughout the schemas because that allows each resource/schema to be revised separately.
If you're making a local copy of the schemas, you could do a global search and replace of the schema repository URI "http://redfish.dmtf.org/schemas/v1" with the path to the local copies.
We'd also encourage schema-aware tools to provide for "local repositories" of schema files to handle exactly this use case (no Internet access). The tools we've written allow for a local repo. I'd suggest you make a request of the jsonschem2pojo folks to add such support - this is not a situation unique to Redfish!
Jeff
|
|
|
Post by dyutiman on Dec 9, 2019 6:33:44 GMT
Thanks for your reply Jeff. I have already made a local copy of the schema. The global search & replace is surely a way to get around this issue. Thanks for the suggession. I have also posted a query to jsonschem2pojo asking for some solution. Here is the URL for reference: github.com/joelittlejohn/jsonschema2pojo/issues/1055Lets see if they accept and come up with any solution in the tool itself. - thanks
|
|