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

Review API-Guidelines: inter-module reference #48

Open
cgendreau opened this issue Mar 30, 2020 · 4 comments
Open

Review API-Guidelines: inter-module reference #48

cgendreau opened this issue Mar 30, 2020 · 4 comments

Comments

@cgendreau
Copy link
Contributor

cgendreau commented Mar 30, 2020

In order to comply with #47 , inter-module references are not enforced at insert/update time. A module pointing to another module should only keep the namespace/context and the id. e.g. agent/bf70a499-89ac-4b83-bc5a-c3e1ca12af51 .

All modules should include asynchronous inter-module reference validation and produce a report of unresolvable references.

@cgendreau
Copy link
Contributor Author

cgendreau commented Mar 30, 2020

Same thing for resource removal. When a resource is soft-deleted (#46), it should also be reported in the asynchronous inter-module reference validation.

@cgendreau cgendreau changed the title Review API-Guidelines: Soft-foreign key Review API-Guidelines: inter-module reference Mar 31, 2020
@cgendreau
Copy link
Contributor Author

cgendreau commented Sep 22, 2020

This should fit in JSON API but there is no "official" way to point to an "external" API.

Option1. Keep the relationship section simple:

"relationships": {
    "dcCreator": {
      "data": { "type": "person", "id": "9" }
    }
  }

and use the meta section to declare types that are external and how to reach them.

"meta": {
  "external": [
    {"type":"person" 
     "href":"dinaapi.org/agent/person"},
    {"type":"organization" 
     "href":"dinaapi.org/agent/organization"}
   ]
}

That would imply modules would need to know (by configuration) how to reach the other modules even if they will not do it themselves (as per #57).

Option 2: The alternative would be to simply ignore it and rely on the system routing to find it. It would work but it might be not obvious for an external user why, for example, the person relationship can not be expended.

@cgendreau
Copy link
Contributor Author

@falkogloeckler you agree with option 1 or 2? @jdobber ?

@falkogloeckler
Copy link

@falkogloeckler you agree with option 1 or 2?

Option 1. Thx!

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

No branches or pull requests

2 participants