Skip to content

Commit

Permalink
Code generation: add comments and deprecation note (#277)
Browse files Browse the repository at this point in the history
* Generate comments and deprecation info

* Generate comments and deprecation info

* Generate comments and deprecation info

* Run codeql on cronjob
  • Loading branch information
gcatanese authored Nov 11, 2024
1 parent d983811 commit e355440
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: "40 12 * * 0"

Expand Down
5 changes: 5 additions & 0 deletions templates/api-single.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ require_relative '{{serviceName}}/{{#lambda.snakecase}}{{classname}}{{/lambda.sn
{{/apiInfo}}

module Adyen

# NOTE: This class is auto generated by OpenAPI Generator
# Ref: https://openapi-generator.tech
#
# Do not edit the class manually.
class {{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}}
attr_accessor :service, :version

Expand Down
9 changes: 9 additions & 0 deletions templates/api-small.mustache
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
require_relative './service'
module Adyen
{{#operations}}

# NOTE: This class is auto generated by OpenAPI Generator
# Ref: https://openapi-generator.tech
#
# Do not edit the class manually.
class {{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}} < Service
attr_accessor :service, :version

Expand All @@ -10,6 +15,10 @@ module Adyen
end

{{#operation}}
# {{{summary}}}{{^summary}}{{operationId}}{{/summary}}{{#isDeprecated}}
#
# Deprecated {{#vendorExtensions.x-deprecatedInVersion}}since {{#appName}}{{{.}}}{{/appName}} v{{.}}{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}}
# {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}{{/isDeprecated}}
def {{#lambda.snakecase}}{{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{nickname}}{{/vendorExtensions.x-methodName}}{{/lambda.snakecase}}({{#bodyParams}}request, {{/bodyParams}}{{#requiredParams}}{{^isQueryParam}}{{#lambda.snakecase}}{{paramName}}{{/lambda.snakecase}}, {{/isQueryParam}}{{/requiredParams}}headers: {}{{#queryParams}}{{#-first}}, query_params: {}{{/-first}}{{/queryParams}})
endpoint = '{{path}}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
Expand Down
9 changes: 9 additions & 0 deletions templates/api.mustache
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
require_relative '../service'
module Adyen
{{#operations}}

# NOTE: This class is auto generated by OpenAPI Generator
# Ref: https://openapi-generator.tech
#
# Do not edit the class manually.
class {{classname}} < Service
attr_accessor :service, :version

Expand All @@ -9,6 +14,10 @@ module Adyen
end

{{#operation}}
# {{{summary}}}{{^summary}}{{operationId}}{{/summary}}{{#isDeprecated}}
#
# Deprecated {{#vendorExtensions.x-deprecatedInVersion}}since {{#appName}}{{{.}}}{{/appName}} v{{.}}{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}}
# {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}{{/isDeprecated}}
def {{#lambda.snakecase}}{{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{nickname}}{{/vendorExtensions.x-methodName}}{{/lambda.snakecase}}({{#bodyParams}}request, {{/bodyParams}}{{#requiredParams}}{{^isQueryParam}}{{#lambda.snakecase}}{{paramName}}{{/lambda.snakecase}}, {{/isQueryParam}}{{/requiredParams}}headers: {}{{#queryParams}}{{#-first}}, query_params: {}{{/-first}}{{/queryParams}})
endpoint = '{{path}}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
Expand Down

0 comments on commit e355440

Please sign in to comment.