Clean up the license field in various templates to ensure it's unlicense by default. (#2627)

This commit is contained in:
kacbuk001 2019-04-09 04:38:06 +02:00 committed by William Cheng
parent 2c26fd3a89
commit 07ebccd455
20 changed files with 229 additions and 13 deletions

View File

@ -14,7 +14,7 @@ sidebar_label: ruby
|gemName|gem name (convention: underscore_case).| |openapi_client| |gemName|gem name (convention: underscore_case).| |openapi_client|
|moduleName|top module name (convention: CamelCase, usually corresponding to gem name).| |OpenAPIClient| |moduleName|top module name (convention: CamelCase, usually corresponding to gem name).| |OpenAPIClient|
|gemVersion|gem version.| |1.0.0| |gemVersion|gem version.| |1.0.0|
|gemLicense|gem license. | |proprietary| |gemLicense|gem license. | |unlicense|
|gemRequiredRubyVersion|gem required Ruby version. | |>= 1.9| |gemRequiredRubyVersion|gem required Ruby version. | |>= 1.9|
|gemHomepage|gem homepage. | |http://org.openapitools| |gemHomepage|gem homepage. | |http://org.openapitools|
|gemSummary|gem summary. | |A ruby wrapper for the REST APIs| |gemSummary|gem summary. | |A ruby wrapper for the REST APIs|

View File

@ -54,7 +54,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
protected String gemVersion = "1.0.0"; protected String gemVersion = "1.0.0";
protected String specFolder = "spec"; protected String specFolder = "spec";
protected String libFolder = "lib"; protected String libFolder = "lib";
protected String gemLicense = "proprietary"; protected String gemLicense = "unlicense";
protected String gemRequiredRubyVersion = ">= 1.9"; protected String gemRequiredRubyVersion = ">= 1.9";
protected String gemHomepage = "http://org.openapitools"; protected String gemHomepage = "http://org.openapitools";
protected String gemSummary = "A ruby wrapper for the REST APIs"; protected String gemSummary = "A ruby wrapper for the REST APIs";
@ -120,7 +120,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
cliOptions.add(new CliOption(GEM_VERSION, "gem version.").defaultValue("1.0.0")); cliOptions.add(new CliOption(GEM_VERSION, "gem version.").defaultValue("1.0.0"));
cliOptions.add(new CliOption(GEM_LICENSE, "gem license. "). cliOptions.add(new CliOption(GEM_LICENSE, "gem license. ").
defaultValue("proprietary")); defaultValue("unlicense"));
cliOptions.add(new CliOption(GEM_REQUIRED_RUBY_VERSION, "gem required Ruby version. "). cliOptions.add(new CliOption(GEM_REQUIRED_RUBY_VERSION, "gem required Ruby version. ").
defaultValue(">= 1.9")); defaultValue(">= 1.9"));

View File

@ -15,7 +15,7 @@
"api" "api"
], ],
"homepage": "http://openapi-generator.tech", "homepage": "http://openapi-generator.tech",
"license": "proprietary", "license": "unlicense",
"authors": [ "authors": [
{ {
"name": "OpenAPI-Generator contributors", "name": "OpenAPI-Generator contributors",

View File

@ -11,7 +11,7 @@
"api" "api"
], ],
"homepage": "https://github.com/openapitools/openapi-generator", "homepage": "https://github.com/openapitools/openapi-generator",
"license": "proprietary", "license": "unlicense",
"authors": [ "authors": [
{ {
"name": "openapi-generator contributors", "name": "openapi-generator contributors",

View File

@ -14,7 +14,7 @@
"api" "api"
], ],
"homepage": "https://openapi-generator.tech", "homepage": "https://openapi-generator.tech",
"license": "proprietary", "license": "unlicense",
"authors": [ "authors": [
{ {
"name": "OpenAPI-Generator contributors", "name": "OpenAPI-Generator contributors",

View File

@ -1,7 +1,7 @@
{ {
"name": "{{gitUserId}}/{{gitRepoId}}", "name": "{{gitUserId}}/{{gitRepoId}}",
"description": "{{description}}", "description": "{{description}}",
"license": "proprietary", "license": "unlicense",
"version": "{{artifactVersion}}", "version": "{{artifactVersion}}",
"type": "project", "type": "project",
"require": { "require": {

View File

@ -11,7 +11,7 @@
"api" "api"
], ],
"homepage": "https://openapi-generator.tech", "homepage": "https://openapi-generator.tech",
"license": "proprietary", "license": "unlicense",
"authors": [ "authors": [
{ {
"name": "OpenAPI-Generator contributors", "name": "OpenAPI-Generator contributors",

View File

@ -11,7 +11,7 @@
"api" "api"
], ],
"homepage": "https://openapi-generator.tech", "homepage": "https://openapi-generator.tech",
"license": "proprietary", "license": "unlicense",
"authors": [ "authors": [
{ {
"name": "OpenAPI-Generator contributors", "name": "OpenAPI-Generator contributors",

View File

@ -5,6 +5,7 @@ Articus\PathHandler\RouteInjection\Factory:
- App\Handler\Fake - App\Handler\Fake
- App\Handler\FakeBodyWithFileSchema - App\Handler\FakeBodyWithFileSchema
- App\Handler\FakeBodyWithQueryParams - App\Handler\FakeBodyWithQueryParams
- App\Handler\FakeHealth
- App\Handler\FakeInlineAdditionalProperties - App\Handler\FakeInlineAdditionalProperties
- App\Handler\FakeJsonFormData - App\Handler\FakeJsonFormData
- App\Handler\FakeOuterBoolean - App\Handler\FakeOuterBoolean
@ -46,6 +47,7 @@ Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory:
App\Handler\Fake: [] App\Handler\Fake: []
App\Handler\FakeBodyWithFileSchema: [] App\Handler\FakeBodyWithFileSchema: []
App\Handler\FakeBodyWithQueryParams: [] App\Handler\FakeBodyWithQueryParams: []
App\Handler\FakeHealth: []
App\Handler\FakeInlineAdditionalProperties: [] App\Handler\FakeInlineAdditionalProperties: []
App\Handler\FakeJsonFormData: [] App\Handler\FakeJsonFormData: []
App\Handler\FakeOuterBoolean: [] App\Handler\FakeOuterBoolean: []

View File

@ -1,7 +1,7 @@
{ {
"name": "GIT_USER_ID/GIT_REPO_ID", "name": "GIT_USER_ID/GIT_REPO_ID",
"description": "", "description": "",
"license": "proprietary", "license": "unlicense",
"version": "1.0.0", "version": "1.0.0",
"type": "project", "type": "project",
"require": { "require": {

View File

@ -40,4 +40,25 @@ class EnumTest
* @var \App\DTO\OuterEnum * @var \App\DTO\OuterEnum
*/ */
public $outer_enum; public $outer_enum;
/**
* @DTA\Data(field="outerEnumInteger", nullable=true)
* @DTA\Strategy(name="Object", options={"type":\App\DTO\OuterEnumInteger::class})
* @DTA\Validator(name="Dictionary", options={"type":\App\DTO\OuterEnumInteger::class})
* @var \App\DTO\OuterEnumInteger
*/
public $outer_enum_integer;
/**
* @DTA\Data(field="outerEnumDefaultValue", nullable=true)
* @DTA\Strategy(name="Object", options={"type":\App\DTO\OuterEnumDefaultValue::class})
* @DTA\Validator(name="Dictionary", options={"type":\App\DTO\OuterEnumDefaultValue::class})
* @var \App\DTO\OuterEnumDefaultValue
*/
public $outer_enum_default_value;
/**
* @DTA\Data(field="outerEnumIntegerDefaultValue", nullable=true)
* @DTA\Strategy(name="Object", options={"type":\App\DTO\OuterEnumIntegerDefaultValue::class})
* @DTA\Validator(name="Dictionary", options={"type":\App\DTO\OuterEnumIntegerDefaultValue::class})
* @var \App\DTO\OuterEnumIntegerDefaultValue
*/
public $outer_enum_integer_default_value;
} }

View File

@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace App\DTO;
use Articus\DataTransfer\Annotation as DTA;
/**
* Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
*/
class HealthCheckResult
{
/**
* @DTA\Data(field="NullableMessage", nullable=true)
* @DTA\Validator(name="Type", options={"type":"string"})
* @var string
*/
public $nullable_message;
}

View File

@ -0,0 +1,104 @@
<?php
declare(strict_types=1);
namespace App\DTO;
use Articus\DataTransfer\Annotation as DTA;
/**
*/
class NullableClass
{
/**
* @DTA\Data(field="integer_prop", nullable=true)
* @DTA\Validator(name="Type", options={"type":"int"})
* @var int
*/
public $integer_prop;
/**
* @DTA\Data(field="number_prop", nullable=true)
* @DTA\Validator(name="Type", options={"type":"float"})
* @var float
*/
public $number_prop;
/**
* @DTA\Data(field="boolean_prop", nullable=true)
* @DTA\Validator(name="Type", options={"type":"bool"})
* @var bool
*/
public $boolean_prop;
/**
* @DTA\Data(field="string_prop", nullable=true)
* @DTA\Validator(name="Type", options={"type":"string"})
* @var string
*/
public $string_prop;
/**
* @DTA\Data(field="date_prop", nullable=true)
* @DTA\Strategy(name="Date")
* @DTA\Validator(name="Date")
* @var \DateTime
*/
public $date_prop;
/**
* @DTA\Data(field="datetime_prop", nullable=true)
* @DTA\Strategy(name="DateTime")
* @DTA\Validator(name="Date", options={"format": \DateTime::RFC3339})
* @var \DateTime
*/
public $datetime_prop;
/**
* @DTA\Data(field="array_nullable_prop", nullable=true)
* TODO check validator and strategy are correct and can handle container item type
* @DTA\Validator(name="Collection", options={"validators":{
* {"name":"Type", "options":{"type":"object"}}
* }})
* @var object[]
*/
public $array_nullable_prop;
/**
* @DTA\Data(field="array_and_items_nullable_prop", nullable=true)
* TODO check validator and strategy are correct and can handle container item type
* @DTA\Validator(name="Collection", options={"validators":{
* {"name":"Type", "options":{"type":"object"}}
* }})
* @var object[]
*/
public $array_and_items_nullable_prop;
/**
* @DTA\Data(field="array_items_nullable", nullable=true)
* TODO check validator and strategy are correct and can handle container item type
* @DTA\Validator(name="Collection", options={"validators":{
* {"name":"Type", "options":{"type":"object"}}
* }})
* @var object[]
*/
public $array_items_nullable;
/**
* @DTA\Data(field="object_nullable_prop", nullable=true)
* TODO check validator and strategy are correct and can handle container item type
* @DTA\Validator(name="Collection", options={"validators":{
* {"name":"Type", "options":{"type":"object"}}
* }})
* @var map[string,object]
*/
public $object_nullable_prop;
/**
* @DTA\Data(field="object_and_items_nullable_prop", nullable=true)
* TODO check validator and strategy are correct and can handle container item type
* @DTA\Validator(name="Collection", options={"validators":{
* {"name":"Type", "options":{"type":"object"}}
* }})
* @var map[string,object]
*/
public $object_and_items_nullable_prop;
/**
* @DTA\Data(field="object_items_nullable", nullable=true)
* TODO check validator and strategy are correct and can handle container item type
* @DTA\Validator(name="Collection", options={"validators":{
* {"name":"Type", "options":{"type":"object"}}
* }})
* @var map[string,object]
*/
public $object_items_nullable;
}

View File

@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace App\DTO;
use Articus\DataTransfer\Annotation as DTA;
/**
*/
class OuterEnumDefaultValue
{
}

View File

@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace App\DTO;
use Articus\DataTransfer\Annotation as DTA;
/**
*/
class OuterEnumInteger
{
}

View File

@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace App\DTO;
use Articus\DataTransfer\Annotation as DTA;
/**
*/
class OuterEnumIntegerDefaultValue
{
}

View File

@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
namespace App\Handler;
use Articus\PathHandler\Annotation as PHA;
use Articus\PathHandler\Consumer as PHConsumer;
use Articus\PathHandler\Producer as PHProducer;
use Articus\PathHandler\Attribute as PHAttribute;
use Articus\PathHandler\Exception as PHException;
use Psr\Http\Message\ServerRequestInterface;
/**
* @PHA\Route(pattern="/fake/health")
*/
class FakeHealth
{
/**
* Health check endpoint
* @PHA\Get()
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
* @param ServerRequestInterface $request
*
* @throws PHException\HttpCode 501 if the method is not implemented
*
* @return \App\DTO\HealthCheckResult
*/
public function fakeHealthGet(ServerRequestInterface $request): \App\DTO\HealthCheckResult
{
//TODO implement method
throw new PHException\HttpCode(501, "Not implemented");
}
}

View File

@ -12,7 +12,7 @@
"api" "api"
], ],
"homepage": "http://openapi-generator.tech", "homepage": "http://openapi-generator.tech",
"license": "proprietary", "license": "unlicense",
"authors": [ "authors": [
{ {
"name": "OpenAPI-Generator contributors", "name": "OpenAPI-Generator contributors",

View File

@ -8,7 +8,7 @@
"api" "api"
], ],
"homepage": "https://github.com/openapitools/openapi-generator", "homepage": "https://github.com/openapitools/openapi-generator",
"license": "proprietary", "license": "unlicense",
"authors": [ "authors": [
{ {
"name": "openapi-generator contributors", "name": "openapi-generator contributors",

View File

@ -1,7 +1,7 @@
{ {
"name": "GIT_USER_ID/GIT_REPO_ID", "name": "GIT_USER_ID/GIT_REPO_ID",
"description": "", "description": "",
"license": "proprietary", "license": "unlicense",
"version": "1.0.0", "version": "1.0.0",
"type": "project", "type": "project",
"require": { "require": {