ingenieux / aws-sdk-typescript

Typescript Bindings Generator for the AWS JavaScript SDK
Apache License 2.0
40 stars 40 forks source link

TSC compile error #21

Open StefH opened 8 years ago

StefH commented 8 years ago

Hi all, I'm using the typings as follows:

{
  "dependencies": {},
  "ambientDependencies": {},
  "globalDependencies": {
    "aws-lambda": "registry:dt/aws-lambda#0.0.0+20160819092144",
    "aws-sdk-typescript": "github:ingenieux/aws-sdk-typescript#HEAD",
    "node": "registry:dt/node#6.0.0+20160831021119"
  }
}

When compiling with tsc, I get this error:

typings/globals/aws-sdk-typescript/index.d.ts(2555,103): error TS1131: Property or signature expected.
typings/globals/aws-sdk-typescript/index.d.ts(2556,12): error TS1005: ';' expected.

This is because:

export interface Model {
        /** The identifier for the model resource. **/
        id?: String;
        /** The name of the model. **/
        name?: String;
        /** The description of the model. **/
        description?: String;
        /** The schema for the model. For application/json models, this should be 
JSON-schema draft v4 [http://json-schema.org/documentation.html] model. Do not
include "\*/" characters in the description of any properties because such "\*/"
characters may be interpreted as the closing marker for comments in some
languages, such as Java or JavaScript, causing the installation of your API's
SDK generated by API Gateway to fail. **/
        schema?: String;
        /** The content-type for the model. **/
        contentType?: String;
    }

Can somebody please fix this ?

miltador commented 8 years ago

+1 on this

aldrinleal commented 8 years ago

Basically cleaning up this comment should solve for now:

diff --git a/typings/globals/aws-sdk-typescript/index.d.ts b/typings/globals/aws-sdk-typescript/index.d.ts
index 1268a2d..ba63037 100644
--- a/typings/globals/aws-sdk-typescript/index.d.ts
+++ b/typings/globals/aws-sdk-typescript/index.d.ts
@@ -2552,8 +2552,7 @@ SUCCEED_WITHOUT_RESPONSE_HEADER . **/
         description?: String;
         /** The schema for the model. For application/json models, this should be 
 JSON-schema draft v4 [http://json-schema.org/documentation.html] model. Do not
-include "\*/" characters in the description of any properties because such "\*/"
-characters may be interpreted as the closing marker for comments in some
+include characters may be interpreted as the closing marker for comments in some
 languages, such as Java or JavaScript, causing the installation of your API's
 SDK generated by API Gateway to fail. **/
         schema?: String;

bear in mind that you also need a promises implementation on your typings.json.

StefH commented 8 years ago

--> bear in mind that you also need a promises implementation on your typings.json.

I don't understand that, what you mean?

StefH commented 8 years ago

Made a PR. https://github.com/ingenieux/aws-sdk-typescript/pull/25

StefH commented 8 years ago

I've indeed that Promise error: typings/globals/aws-sdk-typings/index.d.ts(114737,16): error TS2304: Cannot find name 'Promise'.

My typings.json :

{
  "dependencies": {},
  "ambientDependencies": {},
  "globalDependencies": {
    "node-4": "registry:dt/node-4#4.0.0+20160830122837",
    "promise": "registry:dt/promise#7.1.1+20160602154553"
  },
  "globalDevDependencies": {
    "aws-sdk-typings": "github:stefh/aws-sdk-typescript#HEAD"
  }
}

My typings\index.d.ts file:

/// <reference path="globals/promise/index.d.ts" />
/// <reference path="globals/aws-sdk-typings/index.d.ts" />
/// <reference path="globals/node-4/index.d.ts" />

What else should I fix ?

StefH commented 8 years ago

OK. This will solve it:

{
  "dependencies": {},
  "ambientDependencies": {
  },
  "globalDependencies": {
    "node-4": "registry:dt/node-4#4.0.0+20160830122837"
  },
  "globalDevDependencies": {
    "es6-promise": "registry:dt/es6-promise#0.0.0+20160614011821",
    "aws-sdk-typings": "github:stefh/aws-sdk-typescript#HEAD"
  }
}
DmitryEfimenko commented 8 years ago

+1 to the issue

StefH commented 6 years ago

Any update?