-
Notifications
You must be signed in to change notification settings - Fork 35
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
Questions about doc-generator subsets #432
Comments
The "Common Object" section is still generated from the schema contents. Can you try adding an entry for the "Resource" schema (or wherever else your common objects are actually defined) and filter out properties/values you don't want to appear - and see if that gets reflected in the common objects section. I hope the schemas are all ingested and filtered prior to the creation of that special section. If not, you can probably fake out the generator by listing those as common properties, but never actually placing a [insert_common_objects] directive in your document. Then create a custom schema file for your common objects (subset) and use the #include_fragment command to insert a table that you'd call your "Common Objects". Those are used in DSP2046 to generate the example tables such as the "Payload Annotations":
This is missing functionality that needs to be added for the subset mode. I've opened an issue for this. The only workaround currently would be to edit the schema files to remove the unwanted URIs.
Yes, you can remove entire parameters or provide a subset of the allowable values.
You need to list the Action name as it appears in schema, in your example, that should be
This should work but if they are using a common definition it may depend on the order these are processed. As above, change that action name to
That's a bug, then - but I would like to know if that happens on other object-array properties - this one in particular is an "excerpt" which may be a special case. We need to try it on a non-excerpt array object - but please enter a separate issue on that bug... Glad you're getting use out of the tool and the subset mode - this is why it was created as we saw a need for API documentation tailored to an implementation. Jeff |
Hi Jeff, thank you for your fast reply, appreciate the help!
I tried that. but it does not seem to do anything. As soon as you add a subset config, all the common objects will disappear. Thus my example above (just adding Status to the subset "IncludeSchemas"). But that will actually result in a The #include_fragment seems like a good workaround for now, I will try that. Thanks.
My workaround for now was to overwrite the URIs with the syntax you see in my example above. For this I just had to make this quick change in the if profile.get('URIs'):
uris = profile['URIs']
else:
uris = details['uris'] to if subset.get('URIs'):
uris = subset['URIs']
elif profile.get('URIs'):
uris = profile['URIs']
else:
uris = details['uris']
Indeed that works. I just wonder, do you know why for the CertificateService it seems to be the opposite? "CertificateService" :{
"Actions": {
"GenerateCSR": {
"Parameters": {
"KeyUsage": {"SupportedValues": ["ClientAuthentication"]}
}
}
}
} and this does actually not work (using #CertificateService.GenerateCSR) "CertificateService" :{
"Actions": {
"#CertificateService.GenerateCSR": {
"Parameters": {
"KeyUsage": {"SupportedValues": ["ClientAuthentication"]}
}
}
}
}
Does not seem to change anything. I also tried changing the order of the actions, but that had no effect either. Any other idea? Or should we consider this a bug too then?
Indeed, seems only the excerpts don't work. Event/Events for example is an array element that does change. I created a new issue #434 |
Hey,
I am using the doc-generator to create a redfish specification that reflects our concrete implementation. So I use the subset functionality for it, pretty cool! Thanks for releasing that.
I got pretty far, but there are still some things I seem not to be able to do via the configs (at least not without changing the generator/formatter). Could you perhaps confirm that the following points are not possible right now? (And if thats actually not the case, please let me know how to do it.) I also add examples to show how I guessed it should work.
1. Customize "Common Objects" section
Let's say I want to have only a handful of common objects to show there (e.g. IPv4Address, Status) and I also want only a subset of their properties to show (e.g. no Oem property) and limit the supported values of some properties (State with only three possible values).
2. Edit list of Resource Collection URIs
Some resource collection URIs are not available in our implementation, which is why I want to remove them from the list. E.g. I want to overwrite them like this:
3. Edit Action properties
Let's say I want to edit the parameters of CollectDiagnosticData action, limit the options for DiagnosticDataType and remove the property OEMDiagnosticDataType.
4. Edit a property that is part of two actions
E.g. there is ResetType which is a property of action Reset and ResetToDefaults. I want to remove two properties from each
5. Remove properties from elements inside an array property
Let's say you want to only use DataSourceUri and Reading inside the elements of the RailCurrentAmps property.
With non-array properties I can do it like in the example, for array properties it does not work.
The text was updated successfully, but these errors were encountered: