Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow additional data #361

Open
cosmo0 opened this issue Jul 29, 2024 · 1 comment
Open

Allow additional data #361

cosmo0 opened this issue Jul 29, 2024 · 1 comment

Comments

@cosmo0
Copy link

cosmo0 commented Jul 29, 2024

Every implementation I've seen of the BCF API has additional data in the responses; it's only natural, since every software has features not found in others that they want to handle.

However, I think it's possible to standardize these infos (at least some of them), so that a client could at least display them, and even allow to dynamically generate a form with values. There's already some semblance of this in the files_information endpoint but I think it's not enough.

Here's a quick example.

Define data

Create a /meta route suffix for some routes: projects, topics, files, comments, documents. I feel these are probably the most likely to have non-standardized informations.

  • /bcf/{version}/projects/meta
  • /bcf/{version}/projects/{project_id}/topics/meta
  • /bcf/{version}/projects/{project_id}/topics/{guid}/files/meta
  • /bcf/{version}/projects/{project_id}/topics/{guid}/comments/meta
  • /bcf/{version}/projects/{project_id}/documents/meta

These routes would return the following informations:

[
  {
    "code": "X",
    "label": "Label X",
    "id": "f8fab089-e26a-46d1-8a6c-721e4a8435d8",
    "is_mandatory": false,
    "is_modifiable": true,
    "maximum_length": 200,
    "value_type": "String"
  },
  {
    "code": "Y",
    "label": "Label Y",
    "id": "9e203f1b-7881-4cda-8dac-acc706184595",
    "is_mandatory": false,
    "ismodifiable": true,
    "maximum_length": 10,
    "value_type": "List",
    "values": [
      {
        "code": "A",
        "label": "Label A"
      },
      {
        "code": "B",
        "label": "Label B"
      }
    ]
  }
]

Display data

The data defined in the /meta endpoint would be returned in the following way, for instance for a project list /bcf/{version}/projects/:

[{
    "project_id": "F445F4F2-4D02-4B2A-B612-5E456BEF9137",
    "name": "Example project 1",
    "additional_data": [
        { "code": "X", "value": "Lorem ispum" },
        { "code": "Y", "value": "A" }
    ]
}, {
    "project_id": "A233FBB2-3A3B-EFF4-C123-DE22ABC8414",
    "name": "Example project 2",
    "additional_data": [
        { "code": "X", "value": "Donec tortor nisi" },
        { "code": "Y", "value": "B" }
    ]
}]
@pasi-paasiala
Copy link
Contributor

This is a feature that is being introduced in the upcoming version 4. Please take look at the schema here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants