Skip to content

Commit 84478a7

Browse files
authored
Fix generator code for case of responses (#942)
Fix #938
1 parent 9330a4a commit 84478a7

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

generator/src/main/resources/line-bot-sdk-nodejs-generator/model.pebble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export type {{classname}}{% if model.model.discriminator != null %}Base{% endif
4141
* @see <a href="{{ model.model.externalDocumentation.url }}">{{ var.name }} Documentation</a>
4242
{% endif -%}
4343
*/
44-
'{{var.name}}'{% if not var.required %}?{% endif %}: {% if var.isEnum %}{{ var.datatypeWithEnum }}{% else %}{{ var.dataType }}{% endif %}{% if var.isNullable %} | null{% endif %}/*{% if var.defaultValue != null %} = {% if var.isEnum %}{{ var.defaultValue.classname }}.{% endif %}{{ var.defaultValue }}{% endif %}*/;
44+
'{{var.baseName}}'{% if not var.required %}?{% endif %}: {% if var.isEnum %}{{ var.datatypeWithEnum }}{% else %}{{ var.dataType }}{% endif %}{% if var.isNullable %} | null{% endif %}/*{% if var.defaultValue != null %} = {% if var.isEnum %}{{ var.defaultValue.classname }}.{% endif %}{{ var.defaultValue }}{% endif %}*/;
4545
{% endfor %}
4646
}
4747
{% endif %}{# ^isEnum #}

lib/channel-access-token/model/errorResponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ export type ErrorResponse = {
2121
/**
2222
* Details of the error. Not returned in certain situations.
2323
*/
24-
errorDescription?: string /**/;
24+
error_description?: string /**/;
2525
};

lib/channel-access-token/model/issueChannelAccessTokenResponse.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ export type IssueChannelAccessTokenResponse = {
1919
*
2020
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token-v2-1">accessToken Documentation</a>
2121
*/
22-
accessToken: string /**/;
22+
access_token: string /**/;
2323
/**
2424
* Amount of time in seconds from issue to expiration of the channel access token
2525
*
2626
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token-v2-1">expiresIn Documentation</a>
2727
*/
28-
expiresIn: number /**/;
28+
expires_in: number /**/;
2929
/**
3030
* A token type.
3131
*
3232
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token-v2-1">tokenType Documentation</a>
3333
*/
34-
tokenType: string /* = 'Bearer'*/;
34+
token_type: string /* = 'Bearer'*/;
3535
/**
3636
* Unique key ID for identifying the channel access token.
3737
*
3838
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token-v2-1">keyId Documentation</a>
3939
*/
40-
keyId: string /**/;
40+
key_id: string /**/;
4141
};

lib/channel-access-token/model/issueShortLivedChannelAccessTokenResponse.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ export type IssueShortLivedChannelAccessTokenResponse = {
1919
*
2020
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-shortlived-channel-access-token">accessToken Documentation</a>
2121
*/
22-
accessToken: string /**/;
22+
access_token: string /**/;
2323
/**
2424
* Time until channel access token expires in seconds from time the token is issued.
2525
*
2626
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-shortlived-channel-access-token">expiresIn Documentation</a>
2727
*/
28-
expiresIn: number /**/;
28+
expires_in: number /**/;
2929
/**
3030
* Token type. The value is always `Bearer`.
3131
*
3232
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-shortlived-channel-access-token">tokenType Documentation</a>
3333
*/
34-
tokenType: string /* = 'Bearer'*/;
34+
token_type: string /* = 'Bearer'*/;
3535
};

lib/channel-access-token/model/issueStatelessChannelAccessTokenResponse.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ export type IssueStatelessChannelAccessTokenResponse = {
1919
*
2020
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token">accessToken Documentation</a>
2121
*/
22-
accessToken: string /**/;
22+
access_token: string /**/;
2323
/**
2424
* Duration in seconds after which the issued access token expires
2525
*
2626
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token">expiresIn Documentation</a>
2727
*/
28-
expiresIn: number /**/;
28+
expires_in: number /**/;
2929
/**
3030
* Token type. The value is always `Bearer`.
3131
*
3232
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token">tokenType Documentation</a>
3333
*/
34-
tokenType: string /* = 'Bearer'*/;
34+
token_type: string /* = 'Bearer'*/;
3535
};

lib/channel-access-token/model/verifyChannelAccessTokenResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ export type VerifyChannelAccessTokenResponse = {
1717
/**
1818
* The channel ID for which the channel access token was issued.
1919
*/
20-
clientId: string /**/;
20+
client_id: string /**/;
2121
/**
2222
* Number of seconds before the channel access token expires.
2323
*/
24-
expiresIn: number /**/;
24+
expires_in: number /**/;
2525
/**
2626
* Permissions granted to the channel access token.
2727
*/

lib/module-attach/model/attachModuleResponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export type AttachModuleResponse = {
1717
/**
1818
* User ID of the bot on the LINE Official Account.
1919
*/
20-
botId: string /**/;
20+
bot_id: string /**/;
2121
/**
2222
* Permissions (scope) granted by the LINE Official Account admin.
2323
*/

0 commit comments

Comments
 (0)