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

bug: slice types should be omitted when empty, else they are 'null' in resulting JSON #14

Open
devillecodes opened this issue Nov 26, 2020 · 0 comments
Assignees
Labels
type: bug Something isn't working

Comments

@devillecodes
Copy link

devillecodes commented Nov 26, 2020

The resulting JSON for the checkly.Check struct contains null values for slice values that are not provided. Examples of this are:

  • Check.Locations
  • Check.EnvironmentVariables
  • Check.Tags
  • Request.Headers
  • Request.QueryParameters
  • Request.Assertions

We should add the ,omitempty annotation so that these values are not passed as null in the JSON.

@devillecodes devillecodes changed the title Array types should be omitted when empty, else they are 'null' in resulting JSON Slice types should be omitted when empty, else they are 'null' in resulting JSON Nov 26, 2020
devillecodes added a commit to devillecodes/checkly-go-sdk that referenced this issue Nov 26, 2020
@ianaya89 ianaya89 self-assigned this Jun 16, 2021
ianaya89 pushed a commit that referenced this issue Jul 6, 2021
* make AlertSettings pointer types; fixes #13

* add omitempty to optional slices; fixes #14

Co-authored-by: Nacho Anaya <[email protected]>
@ianaya89 ianaya89 added the type: bug Something isn't working label Jun 27, 2022
@ianaya89 ianaya89 changed the title Slice types should be omitted when empty, else they are 'null' in resulting JSON bug: slice types should be omitted when empty, else they are 'null' in resulting JSON Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants