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

  • Home
  • SEARCH
  • 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 5960989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:54:08+00:00 2026-05-22T18:54:08+00:00

I am designing my first RESTful API (with the hypermedia constraint). I am not

  • 0

I am designing my first RESTful API (with the hypermedia constraint).

I am not sure if I framed the question correctly but here is an example.

Assume I had a product resource:

/products/{id}

There is a product_type element in the response.

Possible product types include (industry specific)

  1. Floor Display
  2. Dump Display
  3. Light Bulk
  4. …

My question is, what is the best way for the client to retrieve all of the possible attributes for the product resource?

I thought about exposing a “Metadata” sub-resource. For example:

product/metadata/type
product/metadata/status
product/metadata/material
product/metadata/color

… for every attribute that contains N items.

I’m afraid that my solution is too tightly coupled to the product collection. I am restricting attribute listings that could be used in another context (collection).

Another option is to provide a Metadata collection that contains all possible attributes but I’m not sure if that’s the best way of handling it.

Any pointers would be greatly appreciated.

  • 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-22T18:54:09+00:00Added an answer on May 22, 2026 at 6:54 pm

    How about simply returning the metadata as part of a GET on that resource?

    For example, if I GET /products/123, I might receive the following payload in the response (assuming a JSON media type):

    {
       "type" : "Floor Display",
       "color" : "Blue",
       "material" : "wood",
       ...
    }
    

    And so forth. Now if you need to more information about each attribute then you could make each one a subordinate resource and have the URIs returned rather than the simple values that I’ve listed above.

    Edit:

    Now if you want to make the client aware of all possible values then that should be specified outside of your response as part of your media type documentation. It’s not going to be useful to put that kind of “schema” information into your responses.

    Along the same vein, an HTTP response can return codes like 200, 404, 503, etc but the response does not list all possible codes nor does it define their semantics. Instead, that’s the job of the HTTP specification.

    I would take the same approach and define the structure and semantics of your media types in your API documentation and only transmit the value(s) relevant to the response. I can’t think of any benefit to including all possible values directly within the response.

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

Sidebar

Related Questions

First time poster here but definitely not a first time reader. My question is
I'm designing a game for the first time, but I wonder on what game
My first post here – hoping you can help me with designing an algorithm
I'm designing my first good sized project and I want to be sure I'm
I'm designing my first database for MySQL and the idea here is that we
I'm designing my first API for a web app based on a MongoDB datastore.
When designing REST API is it common to authenticate a user first? The typical
Let's assume we are designing a Stack class test-first (TDD): public class Stack<T> {
I am currently working on designing my first FPS game using JOGL. (Java bindings
I am designing a web application using GWT currently, which is also the first

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.