Closed duncandewhurst closed 6 years ago
Assigning @Bjwebb as one of the committers on mapping-sheet-generator (the code for the mapping-sheet subcommand is just a copy of that).
Looks like the problem is the deepcopy introduced in this commit - https://github.com/open-contracting-archive/mapping-sheet-generator/commit/87bc6e1e79738cccf3ee96340a4132a156ff5613
It would be useful to be able to see the associated issue - https://github.com/open-contracting-archive/mapping-sheet-generator/issues/3 - but I can't, presumably because that repo is archived. Which is odd, because GitHub says "You can also search for issues and pull requests within archived repositories.". @jpmckinney do you know anything more about this?
Ah, it's because issues were also disabled. I've enabled issues, so that link should now work.
Some code to fix this is now available on the 42-reference
branch https://github.com/open-contracting/ocdskit/pull/51
Currently the flattened schema produced by the mapping-sheet script omits the original description (and other properties) for objects where a reference is used, this means users of the flattened schema may miss out on important context.
Example 1:
The
description
forbuyer
is:However in the flattened schema this is replaced by the
description
from the referencedorganizationReference
object:So the user misses out on the distinction between buyer and procuring entity.
Example 2:
The
description
fororganizationReference/address
is:However in the flattened schema this is replaced by the
description
from the referencedaddress
object:So the user can't see that the
address
object is deprecated in this case (the deprecation properties are not set because theaddress
object itself has not been deprecated, just it's use in this location)Suggested approach:
Where the reference is inside an array the mapping-sheet already produces two rows, one for the array and one for the objects in it, e.g.
We could extend that behavior to references which aren't in arrays, using a type of "reference" for the row displaying the properties of the parent: