Skip to content

JsonApiEndpoints documentation #1298

Open
@verdie-g

Description

@verdie-g

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.

Activity

bkoelman

bkoelman commented on Aug 19, 2023

@bkoelman
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

bkoelman commented on Aug 20, 2023

@bkoelman
Member

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

verdie-g

verdie-g commented on Aug 20, 2023

@verdie-g
SponsorContributorAuthor

Sure #1301

linked a pull request that will close this issue on Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @verdie-g@bkoelman

      Issue actions

        JsonApiEndpoints documentation · Issue #1298 · json-api-dotnet/JsonApiDotNetCore