ocsf-server icon indicating copy to clipboard operation
ocsf-server copied to clipboard

JSON Schema export

Open zschmerber opened this issue 11 months ago • 4 comments

It would be nice to be able to export the whole JSON schema via the Schema server for internal usage.

Some other nice features would be adding a switch to tell the server how deep you want it to go when exporting some of the circular nested fields

zschmerber avatar Feb 27 '24 17:02 zschmerber

Note that, json-schema of a class is already exportable via the server. Check "JSON Schema" button in the screenshot below.

Screenshot 2024-02-27 at 13 06 28

floydtree avatar Feb 27 '24 18:02 floydtree

I was just looking into this. I think this is documented in the api docs here https://schema.ocsf.io/doc/index.html#/Schema%20Export/SchemaWeb_SchemaController_export_schema. an example would be https://schema.ocsf.io/export/schema?extenions=linux,win. What I'm currently on sure of is how the profiles affect the schema exported. When I apply profiles they seem to get smaller.

overly-engineered avatar Mar 11 '24 16:03 overly-engineered

@overly-engineered:

Two things to note:

  1. The /export/schema URL and the other /export URLs return the OCSF's own definition format. These are not in JSON Schema format. The JSON Schema exporting is on the /schema URL paths.
  2. The extensions and profiles parameters are filters. Without them, all extensions and profiles are included. With them, only the extensions and profiles specified are included. The documentation isn't clear that this is a filtering mechanism, and doesn't mention that if the parameter is supplied but is empty, it means filter out all.

rmouritzen-splunk avatar Mar 14 '24 21:03 rmouritzen-splunk

Ah that is good to know. Thanks @rmouritzen-splunk!

overly-engineered avatar Mar 18 '24 11:03 overly-engineered