Skip to content

Commit 02b5a02

Browse files
authored
feat: add deprecated in more places (#338)
1 parent 7df956c commit 02b5a02

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/schema.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ const getObjectTypeContent = (schema) => {
146146
rawTypeData.description ||
147147
_.compact(_.map(rawTypeData[getComplexType(rawTypeData)], "description"))[0] ||
148148
"",
149+
!_.isUndefined(property.deprecated) && `@deprecated`,
149150
!_.isUndefined(property.format) && `@format ${property.format}`,
150151
!_.isUndefined(property.minimum) && `@min ${property.minimum}`,
151152
!_.isUndefined(property.maximum) && `@max ${property.maximum}`,

templates/base/data-contracts.eta

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<%
22
const { modelTypes, utils } = it;
33
const { formatDescription, require, _ } = utils;
4-
4+
55

66
const dataContractTemplates = {
77
enum: (contract) => {
@@ -20,6 +20,7 @@
2020

2121
return _.compact([
2222
contract.description && formatDescription(contract.description),
23+
contract.typeData.deprecated === true && '@deprecated',
2324
!_.isUndefined(contract.typeData.format) && `@format ${contract.typeData.format}`,
2425
!_.isUndefined(contract.typeData.minimum) && `@min ${contract.typeData.minimum}`,
2526
!_.isUndefined(contract.typeData.maximum) && `@max ${contract.typeData.maximum}`,

0 commit comments

Comments
 (0)