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

Generalized handling of link objects #1062

Closed
maurei opened this issue Sep 1, 2021 · 2 comments · Fixed by #1518
Closed

Generalized handling of link objects #1062

maurei opened this issue Sep 1, 2021 · 2 comments · Fixed by #1518
Labels

Comments

@maurei
Copy link
Member

maurei commented Sep 1, 2021

The current state of the OpenApi integration has a hardcoded configuration for where and when links are included in schemas.

In JADNC this can be configured by:

  • toggling JsonApiOptions.DefaultPageSize (enabling/disabling paging links)
    • This wouldn't be correct. Even when pagination is turned off by default, it can still be activated per request using the page[size] query string parameter.
  • LinkTypes cascading configuration

These settings should be taken into account when links are included or excluded in the generation of schemas.

@bkoelman
Copy link
Member

bkoelman commented Mar 11, 2024

Should include an end-to-end test for describedby with a non-default path (see https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/openapi/docs/usage/openapi.md#customizing-the-route-template).

@bkoelman
Copy link
Member

bkoelman commented Mar 14, 2024

Should include a test for the following scenario:

GET /api/todoItems/1/assignee HTTP/1.1
{
  "data": {
    "type": "people",
    "id": "1",
    "attributes": {
    },
    "relationships": {
    },
    "links": {
      "self": "/api/people/1" // <---
    }
  }
}

Where the marked link is omitted from the response when the /api/people/1 endpoint is unavailable.

Edit: Based on the insights gained from implementing #1518 (ie not hiding as many links as possible), this test doesn't need to be added. Hides_links_for_unregistered_controllers already verifies the link value is null in a similar case, which is unrelated to OpenAPI.

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

Successfully merging a pull request may close this issue.

2 participants