json-schema-to-typescript icon indicating copy to clipboard operation
json-schema-to-typescript copied to clipboard

Add support for `deprecated` keyword

Open bluishoul opened this issue 3 years ago • 1 comments

json-schema-spec PR: https://github.com/json-schema-org/json-schema-spec/pull/737

json-schema doc: https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.3

Usage:

{
  "$schema": "http://json-schema.org/draft/2019-09/schema#",
  "title": "Example Schema",
  "type": "object",
  "properties": {
    "firstName": {
      "type": "string",
      "deprecated": true
    },
  },
  "additionalProperties": false,
  "required": [
    "firstName"
  ]
}

Expected:

/* tslint:disable */
/**
 * This file was automatically generated by json-schema-to-typescript.
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
 * and run json-schema-to-typescript to regenerate this file.
 */

export interface ExampleSchema {
  /** @deprecated **/
  firstName: string;
}

bluishoul avatar Feb 23 '22 09:02 bluishoul

Hello @bcherny ,

Thank you for such a nice library!(I sometimes use this with serverless framework!)

I want to contribute to this issue. I am new to open source projects, so would you mind if you help me where to look it from?

simonNozaki avatar Jun 13 '22 23:06 simonNozaki