sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Add optional `schema` property to `StepEntityMetadata` & `StepRelationshipMetadata`

Open ndowmon opened this issue 5 years ago • 2 comments

As we move closer to specification-defined integrations, I propose adding an optional schema property to the StepEntityMetadata and StepRelationshipMetadata interfaces.

This schema can be used in:

  1. conversion tests (expect(entities).toMatchGraphObjectSchema({ _class: entities.USER._class, schema: entities.USER.schema})),
  2. Documentation (docs/jupiterone.md, or maybe somewhere we could store more verbose documentation)

ndowmon avatar Mar 30 '21 19:03 ndowmon

Sounds good to me. My only thought before implementing this would be, is there a way to have this happen automatically, potentially by hooking into the Polly recordings?

mknoedel avatar Mar 30 '21 20:03 mknoedel

I'm not sure the polly recordings are the right place to put this schema validation. Those recordings will match whatever data structure the API returns, but this schema is used to match JupiterOne entities/relationships that we have constructed with that data.

I do think that schema-defined entities and relationships will open up some great opportunities to improve our testing strategies.

ndowmon avatar Mar 30 '21 20:03 ndowmon