Skip to content

INTER-2457: [schema review prototype] flat Event from openapi#494 - #117

Draft
JuroUhlar wants to merge 1 commit into
mainfrom
INTER-2457/spike-flat-event
Draft

JuroUhlar wants to merge 1 commit into
mainfrom
INTER-2457/spike-flat-event

Conversation

@JuroUhlar

@JuroUhlar JuroUhlar commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Note

Schema review prototype, do not merge. This is to test the schema Event split (EventDevice | EventEdge) as part of reviewing koala#18895.

INTER-2457 | koala#18895 | schema from openapi#494 @ 78d51f2

Why

This checks that the Go SDK, which reads the flattened fingerprint-server-api-v4-normalized.yaml, regenerates with no breaking change once koala splits Event into EventDevice | EventEdge.

Things to note

  • Not breaking. The only generated code change is the Event doc comment. Fields, types, tags, omitempty, constructors and unmarshalling are unchanged, and Source is still *EventSource. go build, go vet and the full test suite pass.
  • The generator flattens the new description's markdown list into one doc-comment line. Cosmetic.
  • EnvironmentId moved earlier among the schema components. No effect on the generated code.

Change outline

Generated model (internal/openapi/model_event.go):

- // Event Contains results from Fingerprint Identification and all active Smart Signals. …
+ // Event Contains results from Fingerprint Identification and all active Smart Signals, or from the Automation Intelligence API. Check `source` … `edge` … never Identification … Events stored before `source` was added don't have it; treat them as `device`. …
  type Event struct {
      EventID   string       `json:"event_id"`              // unchanged
      Timestamp int64        `json:"timestamp"`             // unchanged
      Source    *EventSource `json:"source,omitempty"`      // unchanged
      …

New test (test/EventSource_test.go):

unmarshal event without `source`   → Source == nil
unmarshal edge event (new mock)    → Source == EventSourceEdge, Identification == nil

Files:

res/fingerprint-server-api-v4.yaml           # synced from openapi#494 (v4-normalized)
internal/openapi/api/openapi.yaml            # regenerated: description + component order
internal/openapi/model_event.go              # regenerated: doc comment only
test/EventSource_test.go                     # new
test/mocks/events/get_event_with_edge_200.json  # upstream mock, new here

Regenerated from fingerprint-server-api-v4-normalized.yaml built from
fingerprintjs/openapi@78d51f2. Adds a test for unmarshalling events
without source and with source: edge.
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR doesn't contain any changesets. If there are user-facing changes, don't forget to run:

pnpm exec changeset

to create a changeset.

@JuroUhlar JuroUhlar changed the title [SPIKE] INTER-2457: flat Event from openapi#494 [schema review prototype] INTER-2457: flat Event from openapi#494 Oct 15, 2026
@JuroUhlar JuroUhlar changed the title [schema review prototype] INTER-2457: flat Event from openapi#494 INTER-2457: [schema review prototype] flat Event from openapi#494 Oct 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant