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

APAP template and agreement identifier improvements #14

Open
niallroche opened this issue Dec 4, 2024 · 1 comment
Open

APAP template and agreement identifier improvements #14

niallroche opened this issue Dec 4, 2024 · 1 comment

Comments

@niallroche
Copy link

Having the name property of the template being used as the identifier has some potential issues regarding the lack of restrictions in the name as it is a string. For example, having a string with no restrictions can cause an issue in using this name as a reliable storage identifier in approaches such as AWS S3 due to object name restrictions. Other storage mechanisms may have similar constraints or max length. There is also the issue of global uniqueness and potential for name clashes. There are likely some trade offs and best practices in REST for client naming versus server naming using something like an auto-increment or a GUID/UUID.

@niallroche
Copy link
Author

Possible Pattern for resource creation responses:

  • HTTP Method: POST to the collection endpoint (e.g., POST /agreements or POST /templates).
  • HTTP Status Code: 201 Created upon successful creation. This clearly indicates that a new resource has been successfully created.
  • Response Headers:
  • Location: Set the Location header to the URI of the newly created resource (e.g., Location: /agreements/{newlyCreatedId}). This helps the client easily find the full resource representation. Consider including version in the url path too.
  • Response Body: Include at least the newly generated ID in the response payload. This might look like:
{
  "id": "09d236f0-4ace-4b1e-a8b5-9cfcb49f32bd",
  "version": "maybe add the version here if that has changed via a PUT request",
  ...
}

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

1 participant