Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move templates in clients #255

Merged
merged 93 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
f31a476
[Ruby] Rename files/folders (#534)
ackintosh Jul 13, 2018
dd1680e
[Ruby] Better handling of operationID starting with a number (#719)
wing328 Aug 2, 2018
43c150b
#714 prevent throwing another exception if the request fails eg conne…
davidvanlaatum Aug 2, 2018
e9c75de
[Ruby] Fix method split (#780)
yinm Aug 10, 2018
6d8f1a8
Generate a Gemfile.lock for the Ruby client, to keep versions consist…
ndbroadbent Sep 4, 2018
f30466e
Added pry-byebug to debug Ruby client (#979)
ndbroadbent Sep 6, 2018
380b5c0
add nullable to Ruby client (#1059)
wing328 Sep 20, 2018
3fb5147
Add "servers" support to Ruby API client (#1280)
wing328 Oct 22, 2018
19b126b
Added tests and fix for issue #1392. Fix regex generated in Ruby cli…
ggershoni Nov 7, 2018
1d86c8a
Fix return_type parameter examples in ruby-client (#1399)
meganemura Nov 12, 2018
c368bc8
Better OpenAPI spec v3 support: allOf, anyOf, oneOf (#1360)
wing328 Dec 6, 2018
8d21297
Improve model class of ruby-client (#1670)
meganemura Dec 15, 2018
7b14de9
Fix various typos in the templates (Ruby, C#) (#1803)
wing328 Jan 5, 2019
bbae8b1
fix index check, add test cases (#1993)
wing328 Jan 27, 2019
044ebec
[Ruby] Use double-quote string to enable string interpolation (#2067)…
autopp Feb 6, 2019
6fe175c
[Ruby] Fix Ruby client to prevent Rubocop's rule violations (#2100) (…
autopp Feb 10, 2019
2d1b9f7
[Ruby] Fix enum expansion in Ruby client (#2081) (#2104)
autopp Feb 11, 2019
ff150dd
[Ruby] Fix regualr expression in error message (#2069) (#2139)
autopp Feb 18, 2019
6be6d87
[Ruby] various improvements (#2226)
wing328 Feb 26, 2019
358c5f8
update ZenTest (#2289)
ota42y Mar 4, 2019
2d89ebb
Outputs dataType to YARD tag (#2329)
ota42y Mar 12, 2019
5a3ef52
[Ruby] Fix type mapping for Ruby (#2385) (#2386)
autopp Mar 17, 2019
86cf5c5
Add RuboCop to Gemfile (#2464)
ackintosh Mar 21, 2019
84c2094
[Ruby] Use Integer instead of Fixnum in Ruby client (#2475) (#2481)
autopp Mar 23, 2019
3f3892a
[#2441] Update documentation mustache templates for proper linting. (…
theWhiteWulfy Mar 25, 2019
41fb68e
Pass opts argument to api client in ruby-client (#2754)
ota42y Apr 28, 2019
c354753
[Ruby] update TargetRubyVersion in .rubocop.yml to 2.4 (#2876)
autopp May 13, 2019
ef15ed2
Minor wording change (#2875)
wing328 May 13, 2019
31494fa
Add support of Bearer Basic Authorization to Ruby client (#2856)
bopm May 15, 2019
21b6bf6
Ruby client: escape path parameters (#3039)
ccouzens Jun 2, 2019
b45e763
Ruby: Avoid double escaping path items (#3093)
ccouzens Jun 5, 2019
3c820e0
Fix rubocop obsolescence (#3175)
rhuanbarreto Jun 19, 2019
4bd05ff
Ruby-client: Don't encode slashes if strict-spec false (#3204)
ccouzens Jun 24, 2019
cb39669
Ruby client faraday (#3405)
dkliban Aug 1, 2019
8ad711b
[Ruby][Faraday] Various improvements (#3520)
wing328 Aug 1, 2019
d7232a3
Problem: faraday ruby client does not respect TLS settings (#3527)
dkliban Aug 2, 2019
8ede101
Use partial for Ruby HTTP libraries (#3539)
wing328 Aug 2, 2019
649b621
[Ruby] remove auto-generated Gemfile.lock (#3541)
wing328 Aug 3, 2019
95b0efc
[Ruby] clean up Ruby dev dependencies (#3551)
wing328 Aug 6, 2019
d9fcd7b
using partials in ruby api_client (#3564)
wing328 Aug 8, 2019
6b4965a
[Ruby][faraday] Properly pass verify_mode to faraday (#3652)
jlsherrill Aug 16, 2019
eaaff70
fix the model's `valid?` of Ruby client to prevent runtime error (#36…
autopp Aug 19, 2019
2d043db
Support custom git repository (#3757)
qmuntal Sep 3, 2019
b62bbe1
[Ruby] fix ruby test, update error message (#4041)
wing328 Oct 3, 2019
fbe5404
Fix readonly with isReadOnly (#4102)
wing328 Oct 9, 2019
256f75b
Ruby client nullable (#4391)
slemrmartin Nov 7, 2019
2fcfc6f
[Ruby] Fix typo in description (#4624)
jirikuncar Nov 28, 2019
d8587f1
delete unused mustache in ruby-client (#4638)
autopp Nov 29, 2019
187dc1b
remove base_object_spec.mustache from ruby client (#4918)
wing328 Jan 3, 2020
1a2e1f0
[HttpBasicAuth] Use positive isBasicBasic tag instead of negative isB…
sebastien-rosset Jan 24, 2020
ad778d6
[Ruby] Fix obsolete configuration of Rubocop and Rubocop's warns (#54…
autopp Feb 28, 2020
260811c
fix CVE-2020-8130 (#5483)
wing328 Feb 29, 2020
700bee9
fix request.on_complete message when tempfile is nil (#5745)
tpltn Mar 31, 2020
bcf0450
Sync master to 5.0.x (#5968)
wing328 Apr 22, 2020
c3c7247
Revert "Sync master to 5.0.x (#5968)"
wing328 Apr 22, 2020
b2a6ddf
Merge branch '5.0-sync-master3' into 5.0.x
wing328 Apr 22, 2020
4f9c854
Fix ruby deprecation error (#6450)
rhuanbarreto May 28, 2020
e1b96a6
remove the json dependency (#6580)
jfeltesse-mdsol Jun 10, 2020
427abb7
[Ruby] ruby client build from hash nullable (#6945)
tsuwatch Jul 16, 2020
e5609a9
rename debugging variables (#7422)
wing328 Sep 15, 2020
4ddb64e
[Ruby] fix port in the Ruby client (#7464)
wing328 Sep 21, 2020
8857eff
[ruby] Support for per-operation servers (#7415)
jirikuncar Sep 24, 2020
87f049b
update default faraday versions (#7538)
wing328 Oct 2, 2020
1ee4add
[Ruby] Feature/ruby client build from hash nullable array (#7609)
tsuwatch Oct 6, 2020
ba7b639
Unifies naming for isMap in Schema class properties (#7640)
spacether Oct 12, 2020
9f84472
Unifies naming for isArray in Schema class properties (#7691)
spacether Oct 19, 2020
a962346
[Ruby] Replace DateTime with Time (#7656)
wing328 Oct 21, 2020
81a6488
[Ruby][faraday] fix response streaming (#7734)
wing328 Oct 26, 2020
7f0b5a1
[Ruby][faraday] fix download_file (#7842)
tsuwatch Oct 31, 2020
e6624c5
Removes secondaryParam and hasMore (#7882)
spacether Nov 7, 2020
a57f367
[ruby] fix oneOf handling (#5706)
jfeltesse-mdsol Nov 23, 2020
e1aad8b
make the generated ruby oneOf specs pass (#8019)
jfeltesse-mdsol Nov 25, 2020
f094c89
[ruby] document the *_with_http_info methods (#8094)
jfeltesse-mdsol Dec 5, 2020
5f4e2db
[ruby] Improve ruby client examples (#8040)
zippolyte Dec 15, 2020
79d6a27
[ruby] Support aliasing of API keys (#8124)
zippolyte Jan 5, 2021
cb25fb7
Fix syntax error (#8675)
miyucy Feb 11, 2021
14ce333
[Ruby] force users to specify the temp folder path to address securit…
wing328 Feb 20, 2021
b6d10d8
Revert "[Ruby] force users to specify the temp folder path to address…
wing328 Feb 23, 2021
e1fd6e7
Add '.generator/templates/' from commit 'b6d10d87733f2c5e38d3802ec0f5…
therve Mar 23, 2021
0457caf
Apply template-patches/ruby-unstable-operations.patch
therve Mar 23, 2021
966db37
Apply template-patches/ruby-alias-auth-keys.patch
therve Mar 23, 2021
0dd5a8e
Apply template-patches/ruby-license-header.patch
therve Mar 23, 2021
96327fd
Apply template-patches/ruby-api-docs.patch
therve Mar 23, 2021
0453b26
Apply template-patches/ruby-doc-unstable-op.patch
therve Mar 23, 2021
0fa8793
Apply template-patches/ruby-gem-require.patch
therve Mar 23, 2021
5d73d8a
Apply template-patches/ruby-examples-with-dd-site.patch
therve Mar 23, 2021
2a7fee7
Apply template-patches/ruby-string-index-for-server-variables.patch
therve Mar 23, 2021
525d77c
Merge branch 'master' into datadog-api-spec/test/therve/templates
api-clients-generation-pipeline[bot] Mar 23, 2021
4c63694
Merge branch 'master' into datadog-api-spec/test/therve/templates
api-clients-generation-pipeline[bot] Mar 23, 2021
8cbaf78
Merge branch 'master' into datadog-api-spec/test/therve/templates
api-clients-generation-pipeline[bot] Mar 23, 2021
07f7966
Merge branch 'master' into datadog-api-spec/test/therve/templates
api-clients-generation-pipeline[bot] Mar 23, 2021
0248a49
Merge branch 'master' into datadog-api-spec/test/therve/templates
api-clients-generation-pipeline[bot] Mar 23, 2021
675a265
Regenerate client from commit 7e667f1 of spec repo
Mar 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.4.1.dev6",
"regenerated": "2021-03-23 10:51:50.194106",
"spec_repo_commit": "34cf37f"
"regenerated": "2021-03-23 14:01:30.773317",
"spec_repo_commit": "7e667f1"
},
"v2": {
"apigentools_version": "1.4.1.dev6",
"regenerated": "2021-03-23 10:52:03.766338",
"spec_repo_commit": "34cf37f"
"regenerated": "2021-03-23 14:01:44.126537",
"spec_repo_commit": "7e667f1"
}
}
}
9 changes: 9 additions & 0 deletions .generator/templates/Gemfile.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source 'https://rubygems.org'

gemspec

group :development, :test do
gem 'rake', '~> 13.0.1'
gem 'pry-byebug'
gem 'rubocop', '~> 0.66.0'
end
146 changes: 146 additions & 0 deletions .generator/templates/README.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# {{gemName}}

{{moduleName}} - the Ruby gem for the {{appName}}

{{#appDescriptionWithNewLines}}
{{{appDescriptionWithNewLines}}}
{{/appDescriptionWithNewLines}}

This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: {{appVersion}}
- Package version: {{gemVersion}}
{{^hideGenerationTimestamp}}
- Build date: {{generatedDate}}
{{/hideGenerationTimestamp}}
- Build package: {{generatorClass}}
{{#infoUrl}}
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
{{/infoUrl}}

## Installation

### Build a gem

To build the Ruby code into a gem:

```shell
gem build {{{gemName}}}.gemspec
```

Then either install the gem locally:

```shell
gem install ./{{{gemName}}}-{{{gemVersion}}}.gem
```

(for development, run `gem install --dev ./{{{gemName}}}-{{{gemVersion}}}.gem` to install the development dependencies)

or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).

Finally add this to the Gemfile:

gem '{{{gemName}}}', '~> {{{gemVersion}}}'

### Install from Git

If the Ruby gem is hosted at a git repository: https://{{gitHost}}/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}}, then add the following in the Gemfile:

gem '{{{gemName}}}', :git => 'https://{{gitHost}}/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}}.git'

### Include the Ruby code directly

Include the Ruby code directly using `-I` as follows:

```shell
ruby -Ilib script.rb
```

## Getting Started

Please follow the [installation](#installation) procedure and then run the following code:

```ruby
# Load the gem
require '{{{gemName}}}'
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}
# Setup authorization
{{{moduleName}}}.configure do |config|{{#authMethods}}{{#isBasic}}{{#isBasicBasic}}
# Configure HTTP basic authorization: {{{name}}}
config.username = 'YOUR_USERNAME'
config.password = 'YOUR_PASSWORD'{{/isBasicBasic}}{{#isBasicBearer}}
# Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}}
config.access_token = 'YOUR_BEARER_TOKEN'{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}}
# Configure API key authorization: {{{name}}}
config.api_key['{{{name}}}'] = ENV["{{{vendorExtensions.x-env-name}}}"]{{/isApiKey}}{{#isOAuth}}
# Configure OAuth2 access token for authorization: {{{name}}}
config.access_token = 'YOUR ACCESS TOKEN'{{/isOAuth}}
{{/authMethods}}end
{{/hasAuthMethods}}

api_instance = {{{moduleName}}}::{{{classname}}}.new
{{#requiredParams}}
{{{paramName}}} = {{{vendorExtensions.x-ruby-example}}} # {{{dataType}}} | {{{description}}}
{{/requiredParams}}
{{#optionalParams}}
{{#-first}}
opts = {
{{/-first}}
{{{paramName}}}: {{{vendorExtensions.x-ruby-example}}}{{^-last}},{{/-last}} # {{{dataType}}} | {{{description}}}
{{#-last}}
}
{{/-last}}
{{/optionalParams}}

begin
{{#summary}} #{{{.}}}
{{/summary}} {{#returnType}}result = {{/returnType}}api_instance.{{{operationId}}}{{#hasParams}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}){{/hasParams}}{{#returnType}}
p result{{/returnType}}
rescue {{{moduleName}}}::ApiError => e
puts "Exception when calling {{classname}}->{{{operationId}}}: #{e}"
end
{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
```

## Documentation for API Endpoints

All URIs are relative to *{{basePath}}*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}::{{classname}}* | [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}

## Documentation for Models

{{#models}}{{#model}} - [{{moduleName}}::{{classname}}]({{classname}}.md)
{{/model}}{{/models}}

## Documentation for Authorization

{{^authMethods}} All endpoints do not require authorization.
{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}}
{{#authMethods}}### {{name}}

{{#isApiKey}}

- **Type**: API key
- **API key parameter name**: {{keyParamName}}
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
{{/isApiKey}}
{{#isBasic}}
{{#isBasicBasic}}- **Type**: HTTP basic authentication
{{/isBasicBasic}}{{#isBasicBearer}}- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
{{/isBasicBearer}}
{{/isBasic}}
{{#isOAuth}}

- **Type**: OAuth
- **Flow**: {{flow}}
- **Authorization URL**: {{authorizationUrl}}
- **Scopes**: {{^scopes}}N/A{{/scopes}}
{{#scopes}} - {{scope}}: {{description}}
{{/scopes}}
{{/isOAuth}}

{{/authMethods}}
10 changes: 10 additions & 0 deletions .generator/templates/Rakefile.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require "bundler/gem_tasks"

begin
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)
task default: :spec
rescue LoadError
# no rspec available
end
Loading