https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26635

--- Comment #61 from Martin Renvoize <[email protected]> ---
So.. for my own sanity.. the final structure is this right:

GET /api/v1/items/1

{
    "_authorized_values": {
        "location": {
            "category": "LOC",
            "description": "General Stacks",
        }
    },
    "acquisition_date": "2014-05-07",
    "acquisition_source": null,
    "biblio_id": 1,
    "item_id": 1,
    ...
    "location": "GEN",
    ...
    "uri": null,
    "withdrawn": 0,
    "withdrawn_date": null
}

GET /api/v1/items

[
  {
    "_authorized_values": {
        "location": {
            "category": "LOC",
            "description": "General Stacks",
        }
    },
    "acquisition_date": "2014-05-07",
    "acquisition_source": null,
    "biblio_id": 1,
    "item_id": 1,
    ...
    "location": "GEN",
    ...
    "uri": null,
    "withdrawn": 0,
    "withdrawn_date": null
  },
  {
    "_authorized_values": {
        "location": {
            "category": "LOC",
            "description": "Birchwood Shelves",
        }
    },
    "acquisition_date": "2017-02-14",
    "acquisition_source": null,
    "biblio_id": 2,
    "item_id": 12,
    ...
    "location": "BIR",
    ...
    "uri": null,
    "withdrawn": 0,
    "withdrawn_date": null
  }
]

So.. an embedded _authorized_values structure per individual object (not at a
top level.. as we can't do that for things like biblios where the framework
governs stuff..)

We keep the lookup as '_authorized' so we know it's an authorized value (not
another coded lookup).. and we include 'category' so we can know the link
between the field and which av category we're looking at (for later lookups
should we want to produce a pick list).. and then we have the interface
specific return for description.

I'm no against also including image url if we think that's helpful.. I could
see if being so.. but it also feels fairly specific to only a minority of AV
cases.. so maybe not too..

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to