Giter VIP home page Giter VIP logo

Comments (4)

smyrman avatar smyrman commented on May 31, 2024

@Dragomir-Ivanov, FYI.

What do you think?

from rest-layer.

Dragomir-Ivanov avatar Dragomir-Ivanov commented on May 31, 2024

@smyrman I think we need to consider also Default fields. What happens if you omit in regular PATCH a field with Default value. Does it stay the same, is it deleted, or it is reset to its default value.
I think regular PATCH syntax as very limited.
I like the idea of having fields as not set and set to empty, but still haven't used that, nor mixed rest-layer with TS (but planning a rewrite to TS asap).

from rest-layer.

smyrman avatar smyrman commented on May 31, 2024

Good ponits @Dragomir-Ivanov.

If files are omitted on PUT (a.k.a update), then yes, reset to default values. If they are explicitly set to nil on PUT, then clear them. This can be done as both operations would be handled by the Validation step, but would not work if the same resource is sent to validation multiple times.

When fetching the resource back out, they will be either omitted or null based on the resource config.

from rest-layer.

smyrman avatar smyrman commented on May 31, 2024

PS! we might need to make sure that PATCH results always serialize (the original) resource before calculating changes / base.

from rest-layer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.