Skip to content

adding deprecated function to BaseSchema#161

Merged
aboutlo merged 2 commits intofastify:masterfrom
victortosts:deprecated_2019-09
Feb 10, 2022
Merged

adding deprecated function to BaseSchema#161
aboutlo merged 2 commits intofastify:masterfrom
victortosts:deprecated_2019-09

Conversation

@victortosts
Copy link
Contributor

Adding support to deprecated values.

Reference:

The value of this keyword MUST be a boolean. When multiple occurrences of this keyword are applicable to a single sub-instance, applications SHOULD consider the instance location to be deprecated if any occurrence specifies a true value.

If "deprecated" has a value of boolean true, it indicates that applications SHOULD refrain from usage of the declared property. It MAY mean the property is going to be removed in the future.

A root schema containing "deprecated" with a value of true indicates that the entire resource being described MAY be removed in the future.

When the "deprecated" keyword is applied to an item in an array by means of "items", if "items" is a single schema, the deprecation relates to the whole array, while if "items" is an array of schemas, the deprecation relates to the corrosponding item according to the subschemas position.

Omitting this keyword has the same behavior as a value of false.

image

Checklist

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1685932661

  • 0 of 5 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 99.575%

Totals Coverage Status
Change from base Build 1683904512: 0.005%
Covered Lines: 426
Relevant Lines: 426

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jan 12, 2022

Pull Request Test Coverage Report for Build 1685932661

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 99.575%

Totals Coverage Status
Change from base Build 1683904512: 0.005%
Covered Lines: 426
Relevant Lines: 426

💛 - Coveralls

@aboutlo
Copy link
Collaborator

aboutlo commented Jan 18, 2022

hey @victortostes-hotmart thank you for this. it looks nice!

You need to add the typescript types too here:
https://github.com/fastify/fluent-json-schema/blob/master/src/FluentJSONSchema.d.ts

and check that it compiles correctly here:
https://github.com/fastify/fluent-json-schema/blob/master/src/types/index.ts

@victortosts
Copy link
Contributor Author

@aboutlo let me know if still something missing 😄

@aboutlo aboutlo merged commit 0232026 into fastify:master Feb 10, 2022
@victortosts victortosts deleted the deprecated_2019-09 branch February 11, 2022 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants