Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

v2 replace openapi generator with openapi json schema generator #113

Merged
merged 3 commits into from
Dec 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/**
* User: lanwen Date: 24.03.15 Time: 17:56
* <p>
* Command line interface for OpenAPI Generator use `openapi-generator-cli.jar help` for more info
* Command line interface for OpenAPI JSON Schema Generator use `openapi-generator-cli.jar help` for more info
*/
public class OpenAPIGenerator {

Expand All @@ -41,7 +41,7 @@ public static void main(String[] args) {
.withDescription(
String.format(
Locale.ROOT,
"OpenAPI Generator CLI %s (%s).",
"OpenAPI JSON Schema Generator CLI %s (%s).",
buildInfo.getVersion(),
buildInfo.getSha()))
.withDefaultCommand(HelpCommand.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@

import org.openapitools.codegen.utils.ModelUtils;

import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/**
* Describes a single operation parameter in the OAS specification.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
* Copyright 2018 SmartBear Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.openapitools.codegen;

import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,9 @@ public void setOpenAPI(OpenAPI openAPI) {
@SuppressWarnings("static-method")
public void postProcess() {
System.out.println("################################################################################");
System.out.println("# Thanks for using OpenAPI Generator. #");
System.out.println("# Thanks for using OpenAPI JSON Schema Generator. #");
System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #");
System.out.println("# https://opencollective.com/openapi_generator/donate #");
System.out.println("# https://github.com/sponsors/spacether #");
System.out.println("################################################################################");
}

Expand Down Expand Up @@ -1387,7 +1387,7 @@ public DefaultCodegen() {
generatorMetadata = GeneratorMetadata.newBuilder()
.stability(Stability.STABLE)
.featureSet(DefaultFeatureSet)
.generationMessage(String.format(Locale.ROOT, "OpenAPI Generator: %s (%s)", getName(), codegenType.toValue()))
.generationMessage(String.format(Locale.ROOT, "OpenAPI JSON Schema Generator: %s (%s)", getName(), codegenType.toValue()))
.build();

defaultIncludes = new HashSet<>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public TemplateProcessor getTemplateProcessor() {

/**
* Programmatically disable the output of .openapi-generator/VERSION, .openapi-generator-ignore,
* or other metadata files used by OpenAPI Generator.
* or other metadata files used by OpenAPI JSON Schema Generator.
*
* @param generateMetadata true: enable outputs, false: disable outputs
*/
Expand Down Expand Up @@ -307,9 +307,9 @@ private void configureOpenAPIInfo() {
if (StringUtils.isEmpty(info.getDescription())) {
// set a default description if none if provided
config.additionalProperties().put("appDescription",
"No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)");
"No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator)");
config.additionalProperties().put("appDescriptionWithNewLines", config.additionalProperties().get("appDescription"));
config.additionalProperties().put("unescapedAppDescription", "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)");
config.additionalProperties().put("unescapedAppDescription", "No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator)");
} else {
config.additionalProperties().put("appDescription", config.escapeText(info.getDescription()));
config.additionalProperties().put("appDescriptionWithNewLines", config.escapeTextWhileAllowingNewLines(info.getDescription()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,9 @@ private static boolean isMultipartType(List<Map<String, String>> consumes) {
@Override
public void postProcess() {
System.out.println("################################################################################");
System.out.println("# Thanks for using OpenAPI Generator. #");
System.out.println("# Thanks for using OpenAPI JSON Schema Generator. #");
System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #");
System.out.println("# https://opencollective.com/openapi_generator/donate #");
System.out.println("# https://github.com/sponsors/spacether #");
System.out.println("# #");
System.out.println("# This generator's contributed by Jim Schubert (https://github.com/jimschubert)#");
System.out.println("# Please support his work directly via https://patreon.com/jimschubert \uD83D\uDE4F #");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2152,9 +2152,9 @@ public String toRefClass(String ref, String sourceJsonPath, String expectedCompo
@Override
public void postProcess() {
System.out.println("################################################################################");
System.out.println("# Thanks for using OpenAPI Generator. #");
System.out.println("# Thanks for using OpenAPI JSON Schema Generator. #");
System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #");
System.out.println("# https://opencollective.com/openapi_generator/donate #");
System.out.println("# https://github.com/sponsors/spacether #");
System.out.println("# #");
System.out.println("# This generator was written by Justin Black (https://github.com/spacether) #");
System.out.println("# Please support his work directly via https://github.com/sponsors/spacether \uD83D\uDE4F#");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{{appDescription}}}
{{/if}}

The `{{packageName}}` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
The `{{packageName}}` package is automatically generated by the [OpenAPI JSON Schema Generator](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) project:

- API version: {{appVersion}}
- Package version: {{packageVersion}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ from urllib3._collections import HTTPHeaderDict

class ApiTestMixin:
json_content_type = 'application/json'
user_agent = 'OpenAPI-Generator/1.0.0/python'
user_agent = 'OpenAPI-JSON-Schema-Generator/1.0.0/python'

@classmethod
def assert_pool_manager_request_called_with(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class {{classname}}(
{{operationIdCamelCase}},
{{/each}}
):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
"""NOTE: This class is auto generated by OpenAPI JSON Schema Generator
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator

Do not edit the class manually.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,8 +943,8 @@ class ApiClient:
the methods and models for each application are generated from the OpenAPI
templates.

NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
NOTE: This class is auto generated by OpenAPI JSON Schema Generator.
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
Do not edit the class manually.

:param configuration: configuration_module.Configuration object for this client
Expand Down Expand Up @@ -978,7 +978,7 @@ class ApiClient:
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = '{{#if httpUserAgent}}{{{httpUserAgent}}}{{/if}}{{#unless httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/unless}}'
self.user_agent = '{{#if httpUserAgent}}{{{httpUserAgent}}}{{/if}}{{#unless httpUserAgent}}OpenAPI-JSON-Schema-Generator/{{{packageVersion}}}/python{{/unless}}'

def __enter__(self):
return self
Expand Down Expand Up @@ -1248,8 +1248,8 @@ class ApiClient:


class Api(TypedDictInputVerifier):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
"""NOTE: This class is auto generated by OpenAPI JSON Schema Generator
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator

Do not edit the class manually.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD = {
}

class Configuration(object):
"""NOTE: This class is auto generated by OpenAPI Generator
"""NOTE: This class is auto generated by OpenAPI JSON Schema Generator

Ref: https://openapi-generator.tech
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
Do not edit the class manually.

:param host: Base url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class {{name.getCamelCaseName}}(
{{/if}}
):
{{#if componentModule}}
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
"""NOTE: This class is auto generated by OpenAPI JSON Schema Generator.
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator

Do not edit the class manually.
{{#if description}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class {{name.getCamelCaseName}}(
schemas.DictSchema
):
{{#if componentModule}}
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
"""NOTE: This class is auto generated by OpenAPI JSON Schema Generator.
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator

Do not edit the class manually.
{{#if description}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class {{name.getCamelCaseName}}(
schemas.ListSchema
):
{{#if componentModule}}
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
"""NOTE: This class is auto generated by OpenAPI JSON Schema Generator.
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator

Do not edit the class manually.
{{#if description}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class {{name.getCamelCaseName}}(
{{> model_templates/xbase_schema }}
):
{{#if componentModule}}
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
"""NOTE: This class is auto generated by OpenAPI JSON Schema Generator.
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator

Do not edit the class manually.
{{#if description}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
{{#if infoEmail}}
Contact: {{{infoEmail}}}
{{/if}}
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ setup(
name=NAME,
version=VERSION,
description="{{appName}}",
author="{{#if infoName}}{{infoName}}{{/if}}{{#unless infoName}}OpenAPI Generator community{{/unless}}",
author="{{#if infoName}}{{infoName}}{{/if}}{{#unless infoName}}OpenAPI JSON Schema Generator community{{/unless}}",
author_email="{{#if infoEmail}}{{infoEmail}}{{/if}}{{#unless infoEmail}}team@openapitools.org{{/unless}}",
url="{{#if packageUrl}}{{packageUrl}}{{/if}}",
keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"],
keywords=["OpenAPI", "OpenAPI-JSON-Schema-Generator", "{{{appName}}}"],
python_requires="{{{generatorLanguageVersion}}}",
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ class HttpSigningConfiguration(object):
and optionally the body of the HTTP request, then signing the hash value using
a private key. The 'Authorization' header is added to outbound HTTP requests.

NOTE: This class is auto generated by OpenAPI Generator
NOTE: This class is auto generated by OpenAPI JSON Schema Generator

Ref: https://openapi-generator.tech
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
Do not edit the class manually.

:param key_id: A string value specifying the identifier of the cryptographic key,
Expand Down
6 changes: 3 additions & 3 deletions samples/openapi3/client/3_0_3_unit_test/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501

The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

from setuptools import setup, find_packages # noqa: H301
Expand All @@ -33,10 +33,10 @@
name=NAME,
version=VERSION,
description="openapi 3.0.3 sample spec",
author="OpenAPI Generator community",
author="OpenAPI JSON Schema Generator community",
author_email="team@openapitools.org",
url="",
keywords=["OpenAPI", "OpenAPI-Generator", "openapi 3.0.3 sample spec"],
keywords=["OpenAPI", "OpenAPI-JSON-Schema-Generator", "openapi 3.0.3 sample spec"],
python_requires=">=3.7",
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501

The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501

The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501

The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501

The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501

The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501

The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501

The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501

The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501

The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501

The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501

The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

import unittest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501

The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

import unittest
Expand Down
Loading