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

Cannot find name 'JsonProperty'

Open LarsLiden opened this issue 9 years ago • 1 comments

Haven't been able to get my project to compile. I installed the npm package as prescribed and I'm on Typescript 2.1.5. Error is "Cannot find name 'JsonProperty'.

My tsconfig file is below. Any suggestions?

{ "compilerOptions": { "experimentalDecorators": true, "emitDecoratorMetadata": true, "importHelpers": true, "compileOnSave": true, "module": "commonjs", "target": "es5", "sourceMap": true, "outDir": "${workspaceRoot}/built/", "sourceRoot" : "${workspaceRoot}/src", "watch" : true, "lib" : ["es2017", "dom"] }, "exclude": [ "node_modules" ] }

Code:

export class TakeTurnResponse { @JsonProperty('orig-text') public originalText : String; }

LarsLiden avatar Feb 08 '17 23:02 LarsLiden

Looks like the readme is missing an import:

import {JsonProperty} from 'json-typescript-mapper'

LarsLiden avatar Feb 08 '17 23:02 LarsLiden