Skip to content

JsonApiEndpoints documentation #1298

New issue

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

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

Already on GitHub? # to your account

Open
verdie-g opened this issue Aug 18, 2023 · 3 comments · May be fixed by #1423
Open

JsonApiEndpoints documentation #1298

verdie-g opened this issue Aug 18, 2023 · 3 comments · May be fixed by #1423

Comments

@verdie-g
Copy link
Contributor

Hi, it's a bit unclear what each value of the JsonApiEndpoints does. For example, I might be missing some JSON:API concept but I'm not sure what GetSecondary is. Would it possible to add XML comments on those? 🙏Ideally, an example endpoint for each would be great.

@bkoelman
Copy link
Member

Sure, sounds good. The endpoints are defined at https://jsonapi.org/format/#fetching. Comments on controllers and services are in place already. See:

/// <summary>
/// Gets a secondary resource or collection of secondary resources. Example: <code><![CDATA[
/// GET /articles/1/author HTTP/1.1
/// ]]></code> Example:
/// <code><![CDATA[
/// GET /articles/1/revisions HTTP/1.1
/// ]]></code>
/// </summary>
public virtual async Task<IActionResult> GetSecondaryAsync(TId id, string relationshipName, CancellationToken cancellationToken)

/// <summary>
/// Handles a JSON:API request to retrieve a single resource or a collection of resources for a secondary endpoint, such as /articles/1/author or
/// /articles/1/revisions.
/// </summary>
Task<object?> GetSecondaryAsync(TId id, string relationshipName, CancellationToken cancellationToken);
.

@bkoelman
Copy link
Member

@verdie-g Would you like to create a PR for this?

@verdie-g
Copy link
Contributor Author

Sure #1301

@verdie-g verdie-g linked a pull request Dec 14, 2023 that will close this issue
4 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Development

Successfully merging a pull request may close this issue.

2 participants