-
Notifications
You must be signed in to change notification settings - Fork 299
Description
What?
Endpoints that support Upsert currently require the key in the route. But when the entity uses identity or auto-generated keys, this route becomes impossible to fulfill.
PATCH
PATCH /api/Entity/Id/{Id}
The URL requires a key, which new records with auto-generated keys don't have.
PUT
PUT /api/Entity/Id/{Id}
The URL requires a key, which new records with auto-generated keys don't have.
Fix
Introduce alternative routes that do not require a key in the URL:
PATCH /entity— handles partial updates and upserts without needing anIdin the pathPUT /entity— handles full replacements or upserts for records with auto-generated keys
ASP.NET supports multiple routes per controller, so this dual-route setup is valid. For backward compatibility, we keep the original routes, but add these new keyless ones to support common identity scenarios. The internal engine logic should be reusable—only the API surface changes.
Other
To keep Swagger/OpenAPI output clean, we might omit the legacy routes from documentation. Otherwise, two PATCH or PUT operations per entity will appear, even though only one is typically the intended usage pattern.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status