Skip to content

[SPIKE option C] Flatten Event; additive /edge (INTER-2457) - #201

Closed
JuroUhlar wants to merge 6 commits into
mainfrom
spike/INTER-2457-option-c
Closed

JuroUhlar wants to merge 6 commits into
mainfrom
spike/INTER-2457-option-c

Conversation

@JuroUhlar

@JuroUhlar JuroUhlar commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

SPIKE. Do not merge. Option C: Event stays a class. Generated from openapi#465. Not the earlier all-SDK union spike (#200), which wrapped Event and dropped .Identification.

  • Event still has .Identification / .Source. Named constructor args and JSON deserialize are unchanged.
  • Additive AnalyzeRequestForAutomationIntelligenceAsync(EdgeRequest) → EventEdge.
  • sync.sh now downloads fingerprint-server-api-v4-normalized.yaml (this repo already generated from the normalized file; sync was pointed at union v4.yaml).

Known: Event constructor argument order

The generated Event( ctor follows flattened schema order. source is no longer the 3rd parameter; linkedId is. Positional Option<> arguments can silently bind to the wrong property (Option<string> slots shifted). Named arguments are safe.

This is the only SDK where Event property reorder is a real (if obscure) API break.

INTER-2457 option C. Event stays a single model; EventEdge is additive for POST /edge.
@changeset-bot

changeset-bot Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d5e52c2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR regenerates the .NET SDK from the “normalized” Server API v4 OpenAPI schema (flattened Event) and adds first-class support for the /edge Automation Intelligence endpoint, including request/response models and API surface updates.

Changes:

  • Switch schema sync to fingerprint-server-api-v4-normalized.yaml and regenerate models to reflect flattened Event.
  • Add /edge API method (AnalyzeRequestForAutomationIntelligenceAsync) plus new models (EdgeRequest, EventEdge, etc.) and JSON converters.
  • Update generated docs and OpenAPI snapshot (res/fingerprint-server-api.yaml) to include /edge and revised Event description.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
sync.sh Points sync at the normalized v4 schema.
src/Fingerprint.ServerSdk/Sealed.cs Registers new JSON converters for edge-related models.
src/Fingerprint.ServerSdk/Model/EventEdge.cs New model + JSON converter for /edge response payload.
src/Fingerprint.ServerSdk/Model/Event.cs Regenerated flattened Event model (constructor + (de)serialization ordering changes).
src/Fingerprint.ServerSdk/Model/EdgeRequestHeadersInner.cs New model + JSON converter for ordered header entries.
src/Fingerprint.ServerSdk/Model/EdgeRequest.cs New model + JSON converter for /edge request payload.
src/Fingerprint.ServerSdk/Client/HostConfiguration.cs Registers new JSON converters for DI-hosted client configuration.
src/Fingerprint.ServerSdk/Client/ApiResponse`1.cs Adds IContentTooLarge<T> response interface for 413 handling.
src/Fingerprint.ServerSdk/Api/FingerprintApi.cs Adds /edge endpoint methods + response types; updates docs/remarks in multiple places.
src/Fingerprint.ServerSdk.Test/mocks/webhook/webhook_event.json Updates webhook event fixture to include source.
res/fingerprint-server-api.yaml Regenerated OpenAPI snapshot including /edge and updated schema docs.
README.md Adds /edge endpoint and new models to documentation lists.
docs/models/EventEdge.md New generated model doc for EventEdge.
docs/models/Event.md Updates generated model doc for flattened/dual-source Event.
docs/models/EdgeRequestHeadersInner.md New generated model doc for EdgeRequestHeadersInner.
docs/models/EdgeRequest.md New generated model doc for EdgeRequest.
docs/FingerprintApi.md Adds /edge endpoint docs and updates various references/remarks.
.openapi-generator/FILES Adds newly generated files to generator manifest.
Suppressed comments (1)

src/Fingerprint.ServerSdk/Api/FingerprintApi.cs:99

  • Same issue as above: the docs mention EventDevice/EventEdge, but the actual OK type is Event.
        /// Get a detailed analysis of an individual event, including Smart Signals.  Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`.  Returns `EventDevice` when `source` is `device`, and `EventEdge` when `source` is `edge`. 

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/FingerprintApi.md Outdated
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService<IFingerprintApi>();

var edgeRequest = new EdgeRequest(); // EdgeRequest |
Comment thread docs/FingerprintApi.md Outdated
Comment thread src/Fingerprint.ServerSdk/Api/FingerprintApi.cs Outdated
Comment on lines +1473 to +1477
private void ValidateAnalyzeRequestForAutomationIntelligence(EdgeRequest edgeRequest)
{
if (edgeRequest == null)
throw new ArgumentNullException(nameof(edgeRequest));
}
@JuroUhlar

Copy link
Copy Markdown
Contributor Author

@copilot review

Co-authored-by: JuroUhlar <11249993+JuroUhlar@users.noreply.github.com>

Copilot AI commented Aug 31, 2026

Copy link
Copy Markdown

@copilot review

Fixed the non-compiling EdgeRequest() example in docs/FingerprintApi.md (commit 2f4c9d0) — it now constructs a minimal valid EdgeRequest with headers, method, url, and ipv4Address, verified to compile against the SDK.

Left the client-side "at least one of ipv4/ipv6" validation suggestion as-is: ValidateAnalyzeRequestForAutomationIntelligence is fully generated from template/api.mustache, which only has a hook for null-checks on required/non-nullable params, not cross-field business rules from prose-only schema constraints (this isn't expressed as anyOf in the OpenAPI spec). Adding it would need a template change affecting all generated SDKs, out of scope for this spike.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ Template files and generated files are not in-sync.

Following files do not match corresponding templates:
docs/FingerprintApi.md

To fix this warning, make sure template files are up-to-date, and generate files by running the following command:

bash ./generate.sh

@github-actions

github-actions Bot commented Sep 4, 2026

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

Copy link
Copy Markdown
Contributor Author

This was a prototype done as part of a spike. Closing now, still usable as a reference during the production implementation.

@JuroUhlar JuroUhlar closed this Sep 14, 2026
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.

3 participants