Repository navigation
Conversation
INTER-2457 option C. Event stays a single model; EventEdge is additive for POST /edge.
|
There was a problem hiding this comment.
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.yamland regenerate models to reflect flattenedEvent. - Add
/edgeAPI method (AnalyzeRequestForAutomationIntelligenceAsync) plus new models (EdgeRequest,EventEdge, etc.) and JSON converters. - Update generated docs and OpenAPI snapshot (
res/fingerprint-server-api.yaml) to include/edgeand revisedEventdescription.
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 isEvent.
/// 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.
| var host = CreateHostBuilder(args).Build(); | ||
| var api = host.Services.GetRequiredService<IFingerprintApi>(); | ||
|
|
||
| var edgeRequest = new EdgeRequest(); // EdgeRequest | |
| private void ValidateAnalyzeRequestForAutomationIntelligence(EdgeRequest edgeRequest) | ||
| { | ||
| if (edgeRequest == null) | ||
| throw new ArgumentNullException(nameof(edgeRequest)); | ||
| } |
|
@copilot review |
Co-authored-by: JuroUhlar <11249993+JuroUhlar@users.noreply.github.com>
Fixed the non-compiling Left the client-side "at least one of ipv4/ipv6" validation suggestion as-is: |
|
Following files do not match corresponding templates: To fix this warning, make sure template files are up-to-date, and generate files by running the following command: bash ./generate.sh |
pnpm exec changesetto create a changeset. |
|
This was a prototype done as part of a spike. Closing now, still usable as a reference during the production implementation. |
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.Eventstill has.Identification/.Source. Named constructor args and JSON deserialize are unchanged.AnalyzeRequestForAutomationIntelligenceAsync(EdgeRequest)→EventEdge.sync.shnow downloadsfingerprint-server-api-v4-normalized.yaml(this repo already generated from the normalized file; sync was pointed at unionv4.yaml).Known: Event constructor argument order
The generated
Event(ctor follows flattened schema order.sourceis no longer the 3rd parameter;linkedIdis. PositionalOption<>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.