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

"Created at" responses should not have a response body #15590

Merged
merged 1 commit into from Jan 17, 2024

Conversation

kjac
Copy link
Contributor

@kjac kjac commented Jan 17, 2024

Prerequisites

  • I have added steps to test this contribution in the description below

Description

Currently the "Created at" responses from the Management API contain a response body with "null". Turns out the built-in CreatedAtActionResult is built upon ObjectResult, which outputs null values in the response body.

The "null" response is messing with the new back-office client.

To work around this, a new EmptyCreatedAtActionResult has been added to the Api.Common, and this is then used for all "Created at" responses created by Management API base controller.

The EmptyCreatedAtActionResult is purposely placed in Api.Common and made public (sealed), so it can be reused in other APIs.

Testing this PR

"Created at" responses are built in different ways depending on the action performed. To test this PR, verify that the following API operations return a HTTP201 status code, and that the response a correct location header:

  • Creating a new script.
  • Creating a new data type folder.
  • Creating a new saved search.

Copy link
Contributor

@nikolajlauridsen nikolajlauridsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 😄 👍

@kjac kjac merged commit 5429aa7 into v14/dev Jan 17, 2024
16 checks passed
@kjac kjac deleted the v14/fix/created-at-action-without-response-body branch January 17, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants