Skip to content

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

Draft
JuroUhlar wants to merge 3 commits into
mainfrom
INTER-2457/schema-review-prototype
Draft

JuroUhlar wants to merge 3 commits into
mainfrom
INTER-2457/schema-review-prototype

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 | searchEvents order fix: koala#18934 | schema from openapi#494 @ 78d51f2

Why

Check that regenerating from fingerprint-server-api-v4-flat.yaml (where Event is one object again) does not break Python users.

Things to note

  • No break from the Event split. Going from the published v4.yaml to the flat schema changes only the Event docstring (event.py, docs/Event.md). source stays Optional[EventSource] = None, no new models or enums, same fields, from_dict/to_dict and __init__ untouched. At schema level, Event equals the published one except description, and the only other change in res/ is EnvironmentId moving earlier. Example files are byte-identical to the published ones.
  • Pre-existing drift, shows up in the baseline commit: search_events (and _with_http_info, _without_preload_content) now take active_call before source, because the published schema lists them in that order. The methods have no *, so only callers passing 50+ arguments positionally would be affected (keyword calls, README and examples/ are fine). It breaks test_search_events_all_params, which hardcodes the old query-string order; fixed in the last commit. koala#18934 fixes the order in koala's schema, so a real sync after it lands won't swap them.
  • Tests: 62 passed, ruff format/check and mypy clean locally. New tests cover a legacy event without source and an edge event (source: edge, no identification).

Change outline

Commits:

1. sync published fingerprint-server-api-v4.yaml + examples (baseline, what a sync does today)
2. sync fingerprint-server-api-v4-flat.yaml @ 78d51f2 (the Event change)
3. tests: legacy/edge Event, search_events param order in test

Generated Event change (commit 2 vs 1), docstring only:

 class Event(BaseModel):
     """
-    Contains results from Fingerprint Identification and all active Smart Signals. Some Smart Signals ...
+    Contains results from Fingerprint Identification and all active Smart Signals, or from the Automation Intelligence API. Check `source` to see which properties can be present: - `device` - ... - `edge` - ... Events stored before `source` was added don't have it; treat them as `device`. ...
     """

Baseline drift (commit 1 vs main), search_events signature (fixed in koala#18934):

-        source: Annotated[Optional[Annotated[list[SearchEventsSource], ...]], Field(...)] = None,
         active_call: Annotated[Optional[StrictBool], Field(...)] = None,
+        source: Annotated[Optional[Annotated[list[SearchEventsSource], ...]], Field(...)] = None,

New tests (test/test_event_source.py):

test_legacy_event_without_source
test_edge_event_without_identification
test_device_event_with_source

Files:

res/fingerprint-server-api.yaml
docs/{Event,FingerprintApi}.md
fingerprint_server_sdk/
  api/fingerprint_api.py   (param order)
  models/event.py          (docstring)
test/
  test_event_source.py
  test_fingerprint_api.py  (param order)
  mocks/events/get_event_with_edge_200.json

@github-actions

Copy link
Copy Markdown
Contributor

☂️ Code Coverage

current status: ✅

Overall Coverage

Statements Covered Coverage Threshold Status
3314 2585 78% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
fingerprint_server_sdk/api/fingerprint_api.py 84% 🟢
fingerprint_server_sdk/models/event.py 97% 🟢
TOTAL 91% 🟢

updated for commit: 06b123d by action🐍

@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 [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