Skip to content

Conversation

@caarlos0
Copy link

this allows to set the jsonschema:"deprecated=true" tag

Signed-off-by: Carlos Alexandro Becker <[email protected]>
caarlos0 added a commit to goreleaser/goreleaser that referenced this pull request Jun 14, 2023
pending invopop/jsonschema#79 the jsonschema should also have the correct deprecated markings

Signed-off-by: Carlos Alexandro Becker <[email protected]>
@samlown samlown added the needs tests Not enough tests for this to be accepted label Sep 6, 2023
@samlown
Copy link
Contributor

samlown commented Sep 6, 2023

Thanks! Tests required. This probably wants to be supported in the array items also.

@caarlos0
Copy link
Author

caarlos0 commented Sep 7, 2023

@samlown thanks, done!

@caarlos0
Copy link
Author

caarlos0 commented Nov 7, 2023

@samlown merged, fixed conflicts

@caarlos0
Copy link
Author

caarlos0 commented Dec 4, 2024

gently ping @samlown

Copy link

@stefanhaller stefanhaller left a comment

Choose a reason for hiding this comment

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

Awesome feature, let me express my interest in having this.

Just one thought about the tag format below.


// Tests for deprecated
DeprecatedField string `json:"deprecated_field" jsonschema:"deprecated=true"`
DeprecatedSlice []string `json:"deprecated_slice" jsonschema:"deprecated=true"`

Choose a reason for hiding this comment

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

I find it surprising that you have to add =true here. When would anybody ever set this to false? I would have expected that you just say jsonschema:"deprecated", like you do e.g. for json:"omitempty".

stefanhaller added a commit to jesseduffield/lazygit that referenced this pull request Mar 23, 2025
)

- **PR Description**

This removes generated Config.md entries that are contain the word:
`deprecated` (case insensitive) anywhere in their header comment.

I think adding in deprecated configs into the reference config clutters
it at best, and encourages users to use those configs at worst. They are
still going to be validated by the schema, but this PR removes them from
the generated config.

I also added in the missing `deprecated` yaml tags in our user config in
anticipation of invopop/jsonschema#79 getting
merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs tests Not enough tests for this to be accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants