activity/tools/vocab/gen
Cory Slep 1c057922ca Fix intransitive activity generated code in vocab.
The sub-types of Intransitive Activity (Arrive, etc) would not satisfy
the vocab.IntransitiveActivityType interface, due to not accounting for
the parent WithoutProperties definition.

This fixes that code generation, so that all Activity subtypes will be
able to be properly converted to vocab.ActivityType or
vocab.IntransitiveActivityType.

Updated the PostOutbox code path to properly handle this distinction
when receiving a C2S IntransitiveActivity.
2018-08-20 23:08:02 +02:00
..
README.md Update all the READMEs 2018-05-30 23:48:34 +02:00
generate.go Remove duplicate intermediate types. 2018-06-17 18:51:30 +02:00
generate_definitions.go Fix intransitive activity generated code in vocab. 2018-08-20 23:08:02 +02:00
generate_property_definitions.go Remove duplicate intermediate types. 2018-06-17 18:51:30 +02:00
util.go Use *url.URL instead of url.URL. 2018-05-29 21:57:39 +02:00
validation.go Tools now pass go vet 2018-05-30 21:40:20 +02:00

README.md

gen

This library is used to generate the go-fed/activity/vocab library implementation. Changes to this will fundamentally change the implementation of the vocab library. If custom ActivityStream types are required, no changes to this are required. Instead, the go-fed/activity/tools/defs library will need edits.

Creating a static type implementation from the specification is not straightforward due to the following considerations that stem from its roots in JSON-LD:

  • Any property could be an IRI (url.URL)
  • Most properties could be another ActivityStream type (map[string]interface{}) or a value (time.Time, etc)
  • Most properties can have multiple values ([]interface{})
  • In a multiple value scenario, each value could once more be an IRI, another ActivityStream type, or a value

The current generation algorithm leaves ample opportunity for improvements and optimizations.