Comments (4)
Proposed design:
Microsoft REST Guidelines
Implementation adheres to Microsoft REST Guidelines
Creating resources via PATCH (UPSERT semantics) Link
"Because PUT is defined as a complete replacement of the content, it is dangerous for clients to use PUT to modify data. Clients that do not understand (and hence ignore) properties on a resource are not likely to provide them on a PUT when trying to update a resource, hence such properties could be inadvertently removed. Services MAY optionally support PUT to update existing resources, but if they do they MUST use replacement semantics (that is, after the PUT, the resource's properties MUST match what was provided in the request, including deleting any server properties that were not provided)."
Sample Requests
- PUT
https://localhost:5001/books/id/1
- If object exists:
JSON Response: HTTP 202 Accepted
JSON Body: Operation-Location:<resourceURI>
- If object does not exist:
JSON Response: HTTP 201 Created
JSON Body: Operation-Location:<resourceURI>
Implementation Notes
Built to handle both inserts and updating an item with only the parameters included in the request,
while deleting/nulling out fields not included in the request.
Tests
UpsertById
- PUT operation on existing item updates the item with declared parameters, nulling out non-included parameters (that are nullable per schema).
- PUT operation on non-existent item, inserts that item with declared parameters.
- (Neg) if autogenerated parameter defined in request body -> 400 Bad Request
from data-api-builder.
Prior to picking this up, please check status of #23 as mutation base elements to be added by PG team (Jelte/Gledis) first then we can iterate. Avoid duplication of work as base elements similar across REST/GraphQL
from data-api-builder.
Find item by id -> update structure. otherwise insert
from data-api-builder.
This represents Case 2 of the PUT behavior outlined in the project-hawaii issue: https://github.com/Azure/project-hawaii/issues/50
from data-api-builder.
Related Issues (20)
- [Bug]: Unable to create new entity and leave ID generation up to the DB, when using `UNIQUEIDENTIFIER DEFAULT NEWID()`
- Pagination logic depends only on hasNextPage, but should also consider endCurso for GraphQL requests.
- Remove duplicate erros from `dab validate`
- Evaluate if refactor of CreateMutation.Build() to accept RuntimeConfig object is beneficial HOT 2
- .NET 8 upgrade HOT 1
- Improve readability and extensibility in the test suite HOT 1
- Validate `linking.source.fields` and `linking.source.fields` define valid backing columns of `linking.object` HOT 2
- Validate source/linkingSource and target/linkingTarget fields in a many to many relationship scenario
- Enhance logic for determining the referencing entity when fields backed by a column with default value is present. HOT 3
- Add codespaces config for .NET 6 and .NET 8 for easier code review
- [Bug]: GraphQL filtering by relation property causes `Incorrect database name ''` HOT 2
- [Bug]: GraphQL type doesn't match any entity name or singular type in the runtime config. HOT 2
- Support multiple create mutation for self-referencing relationships.
- DataApiBuilderException: Cannot obtain Schema for entity with underlying database object source: due to: Connection Timeout Expired. HOT 1
- Container image does not deploy to an ACA environment (v0.11.127) HOT 9
- [Bug]: ./azure-container-apps-deploy.sh is broken. HOT 2
- GraphQL Query failure when mappings exist for relationship fields HOT 1
- [Bug]: GraphQL Query failure when mappings exist for relationship fields
- Add docs for Whats new in 0.11 HOT 2
- Expose Header Information in App Console Logs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from data-api-builder.