Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6999183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:30:30+00:00 2026-05-27T20:30:30+00:00

I have a resource which is essentially a simple CRUD document which has a

  • 0

I have a resource which is essentially a simple CRUD document which has a small twist in that it can be “switched” into a “synchronized” state where-in instead of using it’s own current values it now returns the values of a “parent” document that it is now synchronized with.

I am trying to find a RESTful way to modeling this. The resource has a property which indicates this state Synchronzied = true/false and a ParentId property to indicate which resource it is synced with.

One option is to just allow this to be changed during the PUT updates but that feels somehow incorrect as this isn’t a part of the document but in some respect is metadata about the document. I’ve also considered a POST /document/{id}/synchronized request where the requested state is passed as an argument.

Neither feels quite right though. The first feel a bit awkward because it feels as if I’m parsing the submitted data for just one value, the rest are essentially discarded if we are synchronizing. In the second case it feels wrong to be creating a nested resource just for one property.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:30:31+00:00Added an answer on May 27, 2026 at 8:30 pm

    One solution here is to have two different resource types – full documents and slave documents – distinguished by MIME type. For example, you could have application/vnd.mysite.document for the full document and application/vnd.mysite.documentlink+json when you’re just linking to another document.

    To make a slave document:

    PUT /document/1234
    Content-Type: application/vnd.mysite.documentlink+json
    
    {"parent": "/document/1"}
    

    To make a full document:

    PUT /document/1234
    Content-Type: application/vnd.mysite.document
    
    Hello, I am a document full of stuff.
    

    Then you can respond to GET requests by returning the document or a 303 (See Other) redirect to the parent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a resource (e.g. a filehandle or network socket) which has to
I have a common resource, which I want 1 and only 1 instance of
I have a scenario in which I have REST API which manages a Resource
I have resource bundle with my country characters - how to change them into
I have resource dictionary files (MenuTemplate.xaml, ButtonTemplate.xaml, etc) that I want to use in
I have some resource which I'd like to protect from concurrent usage both by
I have a resource (velocity template) which I'd like to be able to swap
My Android app has a main WebView (HTML loaded from a local resource) which
I have a php application ( http://github.com/tchalvak/ninjawars ), essentially a php-based webgame that I
I have a gem which is essentially just a bunch of ActiveRecord::Base classes in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.