mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-28 19:50:49 +00:00
[core] Initial FeatureSet structures and definitions (#3614)
[core] Initial FeatureSet structures and definitions Add default feature set to DefaultCodegen Initial FeatureSet definitions for: * ada * android * apache2 * asciidoc * aspnetcore * avro * bash * c * clojure * cpp-pistache-server * cpp-qt5-client * cpp-qt5-qhttpengine-server * cpp-restbed-server * cpp-restsdk * cpp-tizen * csharp * csharp-nancyfx * csharp-netcore * cwiki * dart * eiffel * elixir * elm * erlang * flash * fsharp-functions * go Client/Server * graphql-nodejs-express-server * graphql-schema * groovy * haskell * haskell-http-client * java * jmeter * kotlin * kotlin vertx * kotlin-server * kotlin-spring * lua * mysql * nim * nodejs * nodejs-express * objc * ocaml * openapi * openapi-yaml * perl * php * php-laravel * php-lumen * php-silex * php-slim * php-symfony * php-ze-ph * powershell * protobuf * protobuf-schema * python * python-aiohttp * python-blueplanet * python-experimental * r * ror * ruby * ruby * ruby-sinatra * rust * scala-akka * scala-finch * scala-gatling * scala-http-client * scala-lagom * scala-play * scalatra * scalaz * spring * static docs * swift * typescript
This commit is contained in:
parent
4627c7d534
commit
78bf3adc4a
@ -0,0 +1,530 @@
|
||||
/*
|
||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.meta;
|
||||
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Defines the feature set for a target generator.
|
||||
*/
|
||||
@SuppressWarnings({"unused", "WeakerAccess"})
|
||||
public class FeatureSet {
|
||||
public static FeatureSet UNSPECIFIED = FeatureSet.newBuilder().build();
|
||||
|
||||
private EnumSet<ClientModificationFeature> clientModificationFeatures;
|
||||
private EnumSet<DataTypeFeature> dataTypeFeatures;
|
||||
private EnumSet<DocumentationFeature> documentationFeatures;
|
||||
private EnumSet<GlobalFeature> globalFeatures;
|
||||
private EnumSet<SchemaSupportFeature> schemaSupportFeatures;
|
||||
private EnumSet<ParameterFeature> parameterFeatures;
|
||||
private EnumSet<SecurityFeature> securityFeatures;
|
||||
private EnumSet<WireFormatFeature> wireFormatFeatures;
|
||||
|
||||
private FeatureSet(Builder builder) {
|
||||
if (builder != null) {
|
||||
clientModificationFeatures = builder.clientModificationFeatures;
|
||||
dataTypeFeatures = builder.dataTypeFeatures;
|
||||
documentationFeatures = builder.documentationFeatures;
|
||||
schemaSupportFeatures = builder.schemaSupportFeatures;
|
||||
globalFeatures = builder.globalFeatures;
|
||||
parameterFeatures = builder.parameterFeatures;
|
||||
securityFeatures = builder.securityFeatures;
|
||||
wireFormatFeatures = builder.wireFormatFeatures;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder modify() {
|
||||
return FeatureSet.newBuilder(this);
|
||||
}
|
||||
|
||||
public static Builder newBuilder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static Builder newBuilder(FeatureSet copy) {
|
||||
Builder builder = new Builder();
|
||||
if (copy != null) {
|
||||
builder.clientModificationFeatures = copy.getClientModificationFeatures();
|
||||
builder.dataTypeFeatures = copy.getDataTypeFeatures();
|
||||
builder.documentationFeatures = copy.getDocumentationFeatures();
|
||||
builder.schemaSupportFeatures = copy.getSchemaSupportFeatures();
|
||||
builder.globalFeatures = copy.getGlobalFeatures();
|
||||
builder.parameterFeatures = copy.getParameterFeatures();
|
||||
builder.securityFeatures = copy.getSecurityFeatures();
|
||||
builder.wireFormatFeatures = copy.getWireFormatFeatures();
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set of client modification features supported by the generator.
|
||||
*
|
||||
* @return A new copy of the defined feature set. Changes to this instance are not promoted.
|
||||
*/
|
||||
public EnumSet<ClientModificationFeature> getClientModificationFeatures() {
|
||||
if (clientModificationFeatures != null) {
|
||||
return EnumSet.copyOf(clientModificationFeatures);
|
||||
} else {
|
||||
return EnumSet.noneOf(ClientModificationFeature.class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set of common data types supported by the generator
|
||||
*
|
||||
* @return A new copy of the defined feature set. Changes to this instance are not promoted.
|
||||
*/
|
||||
public EnumSet<DataTypeFeature> getDataTypeFeatures() {
|
||||
if (dataTypeFeatures != null) {
|
||||
return EnumSet.copyOf(dataTypeFeatures);
|
||||
} else {
|
||||
return EnumSet.noneOf(DataTypeFeature.class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the documentation type available in generated output.
|
||||
*
|
||||
* @return A new copy of the defined feature set. Changes to this instance are not promoted.
|
||||
*/
|
||||
public EnumSet<DocumentationFeature> getDocumentationFeatures() {
|
||||
if (documentationFeatures != null) {
|
||||
return EnumSet.copyOf(documentationFeatures);
|
||||
} else {
|
||||
return EnumSet.noneOf(DocumentationFeature.class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns special circumstances handled by the generator.
|
||||
*
|
||||
* @return A new copy of the defined feature set. Changes to this instance are not promoted.
|
||||
*/
|
||||
public EnumSet<SchemaSupportFeature> getSchemaSupportFeatures() {
|
||||
if (schemaSupportFeatures != null) {
|
||||
return EnumSet.copyOf(schemaSupportFeatures);
|
||||
} else {
|
||||
return EnumSet.noneOf(SchemaSupportFeature.class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the spec features supported "globally" for a document (shared across all operations and/or models).
|
||||
*
|
||||
* @return A new copy of the defined feature set. Changes to this instance are not promoted.
|
||||
*/
|
||||
public EnumSet<GlobalFeature> getGlobalFeatures() {
|
||||
if (globalFeatures != null) {
|
||||
return EnumSet.copyOf(globalFeatures);
|
||||
} else {
|
||||
return EnumSet.noneOf(GlobalFeature.class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the types of parameters supported by endpoints in the generated code.
|
||||
*
|
||||
* @return A new copy of the defined feature set. Changes to this instance are not promoted.
|
||||
*/
|
||||
public EnumSet<ParameterFeature> getParameterFeatures() {
|
||||
if (parameterFeatures != null) {
|
||||
return EnumSet.copyOf(parameterFeatures);
|
||||
} else {
|
||||
return EnumSet.noneOf(ParameterFeature.class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the security features supported in the generated code.
|
||||
*
|
||||
* @return A new copy of the defined feature set. Changes to this instance are not promoted.
|
||||
*/
|
||||
public EnumSet<SecurityFeature> getSecurityFeatures() {
|
||||
if (securityFeatures != null) {
|
||||
return EnumSet.copyOf(securityFeatures);
|
||||
} else {
|
||||
return EnumSet.noneOf(SecurityFeature.class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the wire format options officially supported by the generated code.
|
||||
*
|
||||
* @return A new copy of the defined feature set. Changes to this instance are not promoted.
|
||||
*/
|
||||
public EnumSet<WireFormatFeature> getWireFormatFeatures() {
|
||||
if (wireFormatFeatures != null) {
|
||||
return EnumSet.copyOf(wireFormatFeatures);
|
||||
} else {
|
||||
return EnumSet.noneOf(WireFormatFeature.class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code FeatureSet} builder static inner class.
|
||||
*/
|
||||
public static final class Builder {
|
||||
private EnumSet<ClientModificationFeature> clientModificationFeatures;
|
||||
private EnumSet<DataTypeFeature> dataTypeFeatures;
|
||||
private EnumSet<DocumentationFeature> documentationFeatures;
|
||||
private EnumSet<SchemaSupportFeature> schemaSupportFeatures;
|
||||
private EnumSet<GlobalFeature> globalFeatures;
|
||||
private EnumSet<ParameterFeature> parameterFeatures;
|
||||
private EnumSet<SecurityFeature> securityFeatures;
|
||||
private EnumSet<WireFormatFeature> wireFormatFeatures;
|
||||
|
||||
private Builder() {
|
||||
this.clientModificationFeatures = EnumSet.noneOf(ClientModificationFeature.class);
|
||||
this.dataTypeFeatures = EnumSet.noneOf(DataTypeFeature.class);
|
||||
this.documentationFeatures = EnumSet.noneOf(DocumentationFeature.class);
|
||||
this.schemaSupportFeatures = EnumSet.noneOf(SchemaSupportFeature.class);
|
||||
this.parameterFeatures = EnumSet.noneOf(ParameterFeature.class);
|
||||
this.securityFeatures = EnumSet.noneOf(SecurityFeature.class);
|
||||
this.globalFeatures = EnumSet.noneOf(GlobalFeature.class);
|
||||
this.wireFormatFeatures = EnumSet.noneOf(WireFormatFeature.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@code clientModificationFeatures} and returns a reference to this Builder so that the methods can be chained together.
|
||||
*
|
||||
* @param clientModificationFeatures the {@code clientModificationFeatures} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder clientModificationFeatures(EnumSet<ClientModificationFeature> clientModificationFeatures) {
|
||||
if (clientModificationFeatures != null) {
|
||||
this.clientModificationFeatures = clientModificationFeatures;
|
||||
} else {
|
||||
this.clientModificationFeatures = EnumSet.noneOf(ClientModificationFeature.class);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes the defined {@link ClientModificationFeature} to the new/existing set of supported features.
|
||||
*
|
||||
* @param clientModificationFeature One or more {@code clientModificationFeature} to ensure are included in the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder includeClientModificationFeatures(ClientModificationFeature... clientModificationFeature) {
|
||||
this.clientModificationFeatures.addAll(Arrays.stream(clientModificationFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Excludes the defined {@link ClientModificationFeature} from the set of supported features.
|
||||
*
|
||||
* @param clientModificationFeature One or more {@code clientModificationFeature} to ensure are excluded from the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder excludeClientModificationFeatures(ClientModificationFeature... clientModificationFeature) {
|
||||
this.clientModificationFeatures.removeAll(Arrays.stream(clientModificationFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@code dataTypeFeatures} and returns a reference to this Builder so that the methods can be chained together.
|
||||
*
|
||||
* @param dataTypeFeatures the {@code dataTypeFeatures} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder dataTypeFeatures(EnumSet<DataTypeFeature> dataTypeFeatures) {
|
||||
if (dataTypeFeatures != null) {
|
||||
this.dataTypeFeatures = dataTypeFeatures;
|
||||
} else {
|
||||
this.dataTypeFeatures = EnumSet.noneOf(DataTypeFeature.class);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes the defined {@link DataTypeFeature} to the new/existing set of supported features.
|
||||
*
|
||||
* @param dataTypeFeature One or more {@code dataTypeFeature} to ensure are included in the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder includeDataTypeFeatures(DataTypeFeature... dataTypeFeature) {
|
||||
this.dataTypeFeatures.addAll(Arrays.stream(dataTypeFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Excludes the defined {@link DataTypeFeature} from the set of supported features.
|
||||
*
|
||||
* @param dataTypeFeature One or more {@code dataTypeFeature} to ensure are excluded from the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder excludeDataTypeFeatures(DataTypeFeature... dataTypeFeature) {
|
||||
this.dataTypeFeatures.removeAll(Arrays.stream(dataTypeFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@code documentationFeature} and returns a reference to this Builder so that the methods can be chained together.
|
||||
*
|
||||
* @param documentationFeatures the {@code documentationFeature} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder documentationFeatures(EnumSet<DocumentationFeature> documentationFeatures) {
|
||||
if (documentationFeatures != null) {
|
||||
this.documentationFeatures = documentationFeatures;
|
||||
} else {
|
||||
this.documentationFeatures = EnumSet.noneOf(DocumentationFeature.class);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes the defined {@link DocumentationFeature} to the new/existing set of supported features.
|
||||
*
|
||||
* @param documentationFeature One or more {@code documentationFeature} to ensure are included in the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder includeDocumentationFeatures(DocumentationFeature... documentationFeature) {
|
||||
this.documentationFeatures.addAll(Arrays.stream(documentationFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Excludes the defined {@link DocumentationFeature} from the set of supported features.
|
||||
*
|
||||
* @param documentationFeature One or more {@code documentationFeature} to ensure are excluded from the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder excludeDocumentationFeatures(DocumentationFeature... documentationFeature) {
|
||||
this.documentationFeatures.removeAll(Arrays.stream(documentationFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@code schemaSupportFeature} and returns a reference to this Builder so that the methods can be chained together.
|
||||
*
|
||||
* @param schemaSupportFeatures the {@code schemaSupportFeature} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder schemaSupportFeatures(EnumSet<SchemaSupportFeature> schemaSupportFeatures) {
|
||||
if (schemaSupportFeatures != null) {
|
||||
this.schemaSupportFeatures = schemaSupportFeatures;
|
||||
} else {
|
||||
this.schemaSupportFeatures = EnumSet.noneOf(SchemaSupportFeature.class);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes the defined {@link SchemaSupportFeature} to the new/existing set of supported features.
|
||||
*
|
||||
* @param schemaSupportFeature One or more {@code schemaSupportFeature} to ensure are included in the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder includeSchemaSupportFeatures(SchemaSupportFeature... schemaSupportFeature) {
|
||||
this.schemaSupportFeatures.addAll(Arrays.stream(schemaSupportFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Excludes the defined {@link SchemaSupportFeature} from the set of supported features.
|
||||
*
|
||||
* @param schemaSupportFeature One or more {@code schemaSupportFeature} to ensure are excluded from the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder excludeSchemaSupportFeatures(SchemaSupportFeature... schemaSupportFeature) {
|
||||
this.schemaSupportFeatures.removeAll(Arrays.stream(schemaSupportFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@code parameterFeature} and returns a reference to this Builder so that the methods can be chained together.
|
||||
*
|
||||
* @param parameterFeatures the {@code parameterFeature} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder parameterFeatures(EnumSet<ParameterFeature> parameterFeatures) {
|
||||
if (parameterFeatures != null) {
|
||||
this.parameterFeatures = parameterFeatures;
|
||||
} else {
|
||||
this.parameterFeatures = EnumSet.noneOf(ParameterFeature.class);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes the defined {@link ParameterFeature} to the new/existing set of supported features.
|
||||
*
|
||||
* @param parameterFeature One or more {@code parameterFeature} to ensure are included in the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder includeParameterFeatures(ParameterFeature... parameterFeature) {
|
||||
this.parameterFeatures.addAll(Arrays.stream(parameterFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Excludes the defined {@link ParameterFeature} from the set of supported features.
|
||||
*
|
||||
* @param parameterFeature One or more {@code parameterFeature} to ensure are excluded from the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder excludeParameterFeatures(ParameterFeature... parameterFeature) {
|
||||
this.parameterFeatures.removeAll(Arrays.stream(parameterFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@code securityFeature} and returns a reference to this Builder so that the methods can be chained together.
|
||||
*
|
||||
* @param securityFeatures the {@code securityFeatures} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder securityFeatures(EnumSet<SecurityFeature> securityFeatures) {
|
||||
if (securityFeatures != null) {
|
||||
this.securityFeatures = securityFeatures;
|
||||
} else {
|
||||
this.securityFeatures = EnumSet.noneOf(SecurityFeature.class);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes the defined {@link SecurityFeature} to the new/existing set of supported features.
|
||||
*
|
||||
* @param securityFeature One or more {@code securityFeature} to ensure are included in the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder includeSecurityFeatures(SecurityFeature... securityFeature) {
|
||||
this.securityFeatures.addAll(Arrays.stream(securityFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Excludes the defined {@link SecurityFeature} from the set of supported features.
|
||||
*
|
||||
* @param securityFeature One or more {@code securityFeature} to ensure are excluded from the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder excludeSecurityFeatures(SecurityFeature... securityFeature) {
|
||||
this.securityFeatures.removeAll(Arrays.stream(securityFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@code globalFeatures} and return a reference to this Builder so that the methods can be chained together.
|
||||
*
|
||||
* @param globalFeatures the {@code globalFeatures} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder globalFeatures(EnumSet<GlobalFeature> globalFeatures) {
|
||||
if (globalFeatures != null) {
|
||||
this.globalFeatures = globalFeatures;
|
||||
} else {
|
||||
this.globalFeatures = EnumSet.noneOf(GlobalFeature.class);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes the defined {@link GlobalFeature} to the new/existing set of supported features.
|
||||
*
|
||||
* @param globalFeature One or more {@code globalFeatures} to ensure are included in the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder includeGlobalFeatures(GlobalFeature... globalFeature) {
|
||||
this.globalFeatures.addAll(Arrays.stream(globalFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Excludes the defined {@link GlobalFeature} from the set of supported features.
|
||||
*
|
||||
* @param globalFeature One or more {@code globalFeatures} to ensure are excluded from the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder excludeGlobalFeatures(GlobalFeature... globalFeature) {
|
||||
this.globalFeatures.removeAll(Arrays.stream(globalFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@code wireFormatFeatures} and return a reference to this Builder so that the methods can be chained together.
|
||||
*
|
||||
* @param wireFormatFeatures the {@code wireFormatFeatures} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder wireFormatFeatures(EnumSet<WireFormatFeature> wireFormatFeatures) {
|
||||
if (wireFormatFeatures != null) {
|
||||
this.wireFormatFeatures = wireFormatFeatures;
|
||||
} else {
|
||||
this.wireFormatFeatures = EnumSet.noneOf(WireFormatFeature.class);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes the defined {@link WireFormatFeature} to the new/existing set of supported features.
|
||||
*
|
||||
* @param wireFormatFeature One or more {@code wireFormatFeatures} to ensure are included in the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder includeWireFormatFeatures(WireFormatFeature... wireFormatFeature) {
|
||||
this.wireFormatFeatures.addAll(Arrays.stream(wireFormatFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Excludes the defined {@link WireFormatFeature} from the set of supported features.
|
||||
*
|
||||
* <p>
|
||||
* This option should only be used if something is overtly broken or not possible in a generator. Please log a warning if invoking this method.
|
||||
* </p>
|
||||
*
|
||||
* @param wireFormatFeature One or more {@code wireFormatFeatures} to ensure are excluded from the set.
|
||||
*
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder excludeWireFormatFeatures(WireFormatFeature... wireFormatFeature) {
|
||||
this.wireFormatFeatures.removeAll(Arrays.stream(wireFormatFeature).collect(Collectors.toList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@code FeatureSet} built from the parameters previously set.
|
||||
*
|
||||
* @return a {@code FeatureSet} built with parameters of this {@code FeatureSet.Builder}
|
||||
*/
|
||||
public FeatureSet build() {
|
||||
return new FeatureSet(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -16,16 +16,29 @@
|
||||
|
||||
package org.openapitools.codegen.meta;
|
||||
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Represents metadata about a generator.
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
public class GeneratorMetadata {
|
||||
private Stability stability;
|
||||
private Map<String, FeatureSet> libraryFeatures;
|
||||
private FeatureSet featureSet;
|
||||
private String generationMessage;
|
||||
|
||||
private GeneratorMetadata(Builder builder) {
|
||||
if (builder != null) {
|
||||
stability = builder.stability;
|
||||
generationMessage = builder.generationMessage;
|
||||
libraryFeatures = builder.libraryFeatures;
|
||||
featureSet = builder.featureSet;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -37,18 +50,13 @@ public class GeneratorMetadata {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder object for {@link GeneratorMetadata}, accepting another instance from which to copy properties.
|
||||
*
|
||||
* @param copy An existing instance to copy defaults from
|
||||
*
|
||||
* @return A new builder instance, with values preset to those of 'copy'.
|
||||
*/
|
||||
public static Builder newBuilder(GeneratorMetadata copy) {
|
||||
Builder builder = new Builder();
|
||||
if (copy != null) {
|
||||
builder.stability = copy.getStability();
|
||||
builder.generationMessage = copy.getGenerationMessage();
|
||||
builder.libraryFeatures = copy.getLibraryFeatures();
|
||||
builder.featureSet = copy.getFeatureSet();
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
@ -71,12 +79,32 @@ public class GeneratorMetadata {
|
||||
return stability;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the feature set supported by the generator.
|
||||
*
|
||||
* @return The set of available features.
|
||||
*/
|
||||
public FeatureSet getFeatureSet() {
|
||||
return featureSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of features supported by generator libraries.
|
||||
*
|
||||
* @return A map of library name to feature set for that library.
|
||||
*/
|
||||
public Map<String, FeatureSet> getLibraryFeatures() {
|
||||
return libraryFeatures;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code GeneratorMetadata} builder static inner class.
|
||||
*/
|
||||
public static final class Builder {
|
||||
private Stability stability;
|
||||
private String generationMessage;
|
||||
private FeatureSet featureSet = FeatureSet.UNSPECIFIED;
|
||||
private Map<String, FeatureSet> libraryFeatures = new HashMap<>();
|
||||
|
||||
private Builder() {
|
||||
}
|
||||
@ -92,6 +120,32 @@ public class GeneratorMetadata {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@code featureSet} and returns a reference to this Builder so that the methods can be chained together.
|
||||
*
|
||||
* @param featureSet the {@code featureSet} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder featureSet(FeatureSet featureSet) {
|
||||
if (featureSet != null) {
|
||||
this.featureSet = featureSet;
|
||||
} else {
|
||||
this.featureSet = FeatureSet.UNSPECIFIED;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@code libraryFeatures} and returns a reference to this Builder so that the methods can be chained together.
|
||||
*
|
||||
* @param libraryFeatures the {@code libraryFeatures} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder libraryFeatures(Map<String, FeatureSet> libraryFeatures) {
|
||||
this.libraryFeatures = libraryFeatures;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@code generationMessage} and returns a reference to this Builder so that the methods can be chained together.
|
||||
*
|
||||
|
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.meta.features;
|
||||
|
||||
import org.openapitools.codegen.meta.features.annotations.ToolingExtension;
|
||||
|
||||
/**
|
||||
* Defines a general set of modifications supported by a generated client.
|
||||
*/
|
||||
public enum ClientModificationFeature {
|
||||
/**
|
||||
* Supports defining a custom overall base path in generated client output.
|
||||
*/
|
||||
@ToolingExtension
|
||||
BasePath,
|
||||
|
||||
/**
|
||||
* Supports customizing authorizations in generated client output.
|
||||
*/
|
||||
@ToolingExtension
|
||||
Authorizations,
|
||||
|
||||
/**
|
||||
* Supports customizing the user agent in generated client output.
|
||||
*/
|
||||
@ToolingExtension
|
||||
UserAgent
|
||||
}
|
@ -0,0 +1,240 @@
|
||||
/*
|
||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.meta.features;
|
||||
|
||||
import org.openapitools.codegen.meta.features.annotations.OAS2;
|
||||
import org.openapitools.codegen.meta.features.annotations.OAS3;
|
||||
import org.openapitools.codegen.meta.features.annotations.ToolingExtension;
|
||||
|
||||
/**
|
||||
* Defines common data types supported by a generator.
|
||||
* Some of these features are defined in specs, and some are specific to the tool.
|
||||
*
|
||||
* Where data types are listed as tool-specific, this either indicates that the data type is common enough that it is an officially
|
||||
* supported custom data type by the toolset (see {@link DataTypeFeature#Decimal}), or that the consideration of a special type isn't
|
||||
* explicitly mentioned by the specification(s) but differs enough across languages that it warrants a special callout (see {@link DataTypeFeature#ArrayOfModel}).
|
||||
*/
|
||||
public enum DataTypeFeature {
|
||||
/**
|
||||
* Supports a generator-specific support usually via type=string's format property (e.g. email, uuid, etc), should be documented in generator README.
|
||||
*
|
||||
* <p>Loosely described in OpenAPI Specification(s). Generally means a custom "format" option applied to a string-typed property.</p>
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Custom,
|
||||
|
||||
/**
|
||||
* Supports integer/int32
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Int32,
|
||||
|
||||
/**
|
||||
* Supports integer/int64
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Int64,
|
||||
|
||||
/**
|
||||
* Supports number/float
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Float,
|
||||
|
||||
/**
|
||||
* Supports number/double
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Double,
|
||||
|
||||
/**
|
||||
* Supports number/decimal (a special case for some languages)
|
||||
*
|
||||
* <p>Decimal is not a type defined by OAS 2.0 specification</p>
|
||||
*/
|
||||
@ToolingExtension
|
||||
Decimal,
|
||||
|
||||
/**
|
||||
* Supports string
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
String,
|
||||
|
||||
/**
|
||||
* Supports string/byte: base64 encoded
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Byte,
|
||||
|
||||
/**
|
||||
* Supports string/binary: any collection of octets
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Binary,
|
||||
|
||||
/**
|
||||
* Supports boolean
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Boolean,
|
||||
|
||||
/**
|
||||
* Supports string/date: full-date RFC3339
|
||||
*
|
||||
* @see <a href="https://tools.ietf.org/html/rfc3339">RFC3339</a>
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Date,
|
||||
|
||||
/**
|
||||
* Supports string/date-time: date-time RFC3339
|
||||
*
|
||||
* @see <a href="https://tools.ietf.org/html/rfc3339">RFC3339</a>
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
DateTime,
|
||||
|
||||
/**
|
||||
* Supports string/password: A hint to UIs to obscure input.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* This should be used as an indicator for password best practices, such as assigning a variable to
|
||||
* a character array rather than string, avoiding logging the variable in clear text, and masking the value
|
||||
* in any user inputs. See OWASP for best practices.
|
||||
* </p>
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Password,
|
||||
|
||||
|
||||
/**
|
||||
* Supports file inputs (e.g. multipart support).
|
||||
*
|
||||
* <p>OAS 3.x defines files differently.</p>
|
||||
* <p>
|
||||
* OAS 3.x does not have an explicit "file" type and instead relies on ContentType or response types.
|
||||
* That's not to say a generator doesn't support files, only that there's no direct
|
||||
* "file" type defined in the spec document.
|
||||
* </p>
|
||||
* <p>
|
||||
* NOTE: The default workflow may provide an "isFile" helper or synthesize the assumptions around files in the case of OAS 3.x.
|
||||
* </p>
|
||||
*/
|
||||
@OAS2
|
||||
File,
|
||||
|
||||
/**
|
||||
* Supports arrays of data
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Array,
|
||||
|
||||
/**
|
||||
* Supports map of data
|
||||
*/
|
||||
@ToolingExtension
|
||||
Maps,
|
||||
|
||||
/**
|
||||
* Supports specifying the format of the array if type array is used (one of: csv, ssv, tsv, pipes).
|
||||
*
|
||||
* <p>
|
||||
* For multi support, check {@link DataTypeFeature#CollectionFormatMulti}. OAS 3.x removes collectionFormat in favor of Style properties.
|
||||
* </p>
|
||||
*/
|
||||
@OAS2
|
||||
CollectionFormat,
|
||||
|
||||
/**
|
||||
* Supports collection format=multi.
|
||||
*
|
||||
* <p>
|
||||
* This is special cased because it is not as easily implemented as a delimiter as with CollectionFormat.
|
||||
* OAS 3.x removes collectionFormat for style properties.
|
||||
* </p>
|
||||
*/
|
||||
@OAS2
|
||||
CollectionFormatMulti,
|
||||
|
||||
/**
|
||||
* Supports enum properties
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Enum,
|
||||
|
||||
/**
|
||||
* Supports an array of enum
|
||||
*/
|
||||
@ToolingExtension
|
||||
ArrayOfEnum,
|
||||
|
||||
/**
|
||||
* Supports an array of models
|
||||
*/
|
||||
@ToolingExtension
|
||||
ArrayOfModel,
|
||||
|
||||
/**
|
||||
* Supports an array of arrays (primitives)
|
||||
*/
|
||||
@ToolingExtension
|
||||
ArrayOfCollectionOfPrimitives,
|
||||
|
||||
/**
|
||||
* Supports an array of arrays (models)
|
||||
*/
|
||||
@ToolingExtension
|
||||
ArrayOfCollectionOfModel,
|
||||
|
||||
/**
|
||||
* Supports an array of arrays (enums)
|
||||
*/
|
||||
@ToolingExtension
|
||||
ArrayOfCollectionOfEnum,
|
||||
|
||||
/**
|
||||
* Supports a map of enums
|
||||
*/
|
||||
@ToolingExtension
|
||||
MapOfEnum,
|
||||
|
||||
/**
|
||||
* Supports a map of models
|
||||
*/
|
||||
@ToolingExtension
|
||||
MapOfModel,
|
||||
|
||||
/**
|
||||
* Supports a map of arrays (primitives)
|
||||
*/
|
||||
@ToolingExtension
|
||||
MapOfCollectionOfPrimitives,
|
||||
|
||||
/**
|
||||
* Supports a map of arrays (models)
|
||||
*/
|
||||
@ToolingExtension
|
||||
MapOfCollectionOfModel,
|
||||
|
||||
/**
|
||||
* Supports a map of arrays (enums)
|
||||
*/
|
||||
@ToolingExtension
|
||||
MapOfCollectionOfEnum
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.meta.features;
|
||||
|
||||
import org.openapitools.codegen.meta.features.annotations.ToolingExtension;
|
||||
|
||||
/**
|
||||
* Defines the documentation type available in generated output.
|
||||
*/
|
||||
public enum DocumentationFeature {
|
||||
/**
|
||||
* Generated output includes a README.
|
||||
*/
|
||||
@ToolingExtension
|
||||
Readme,
|
||||
|
||||
/**
|
||||
* Generated output includes documentation for all generated models.
|
||||
*/
|
||||
@ToolingExtension
|
||||
Model,
|
||||
|
||||
/**
|
||||
* Generated output includes documentation for all generated APIs.
|
||||
*/
|
||||
@ToolingExtension
|
||||
Api;
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.meta.features;
|
||||
|
||||
import org.openapitools.codegen.meta.features.annotations.OAS2;
|
||||
import org.openapitools.codegen.meta.features.annotations.OAS3;
|
||||
|
||||
/**
|
||||
* Defines a set of globally available features. That is, support of these are often defined at the top-level of the spec, or
|
||||
* defines general support of a feature (e.g. Examples, XMLStructureDefinitions).
|
||||
*/
|
||||
public enum GlobalFeature {
|
||||
/**
|
||||
* Supports specifying the host or ip of the target system. If not defined, this should fall back to the
|
||||
* host/ip (and optional port) of the server which delivered the spec document.
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Host,
|
||||
|
||||
/**
|
||||
* Supports providing an API prefix, appended to the host.
|
||||
*
|
||||
* <p>OAS 3.x supports this indirectly via servers with template variables.</p>
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
BasePath,
|
||||
|
||||
/**
|
||||
* Supports passing information about the target server to the client.
|
||||
*
|
||||
* <p>
|
||||
* Information passed to generated code should be explicitly documented in a generator's README.
|
||||
* </p>
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Info,
|
||||
|
||||
/**
|
||||
* Supports customization of the scheme "http", "https", "ws", "wss".
|
||||
*
|
||||
* <p>
|
||||
* If a generator only supports partial schemes, please choose the PartialSchemes option.
|
||||
* </p>
|
||||
*
|
||||
* <p>OAS 3.x supports this indirectly via servers with template variables.</p>
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Schemes,
|
||||
|
||||
/**
|
||||
* Supports fewer than all schemes supported by OpenAPI Specification.
|
||||
*
|
||||
* <p>
|
||||
* Support should be explicitly documented in a generator's README.
|
||||
* </p>
|
||||
*
|
||||
* <p>OAS 3.x supports this indirectly via servers with template variables.</p>
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
PartialSchemes,
|
||||
|
||||
/**
|
||||
* Supports a globally defined array of consumable MimeTypes.
|
||||
*
|
||||
* <p>Global support is undefined in OAS 3.x.</p>
|
||||
*/
|
||||
@OAS2
|
||||
Consumes,
|
||||
|
||||
/**
|
||||
* Supports a globally defined array of produced MimeTypes.
|
||||
*
|
||||
* <p>Global support is undefined in OAS 3.x.</p>
|
||||
*/
|
||||
@OAS2
|
||||
Produces,
|
||||
|
||||
/**
|
||||
* Exposes external documentation defined in the specification document to generated code.
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
ExternalDocumentation,
|
||||
|
||||
/**
|
||||
* Allows the ability to provide example input/output structures, usually in JSON format.
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Examples,
|
||||
|
||||
/**
|
||||
* Differs from supporting the MimeType.XML feature, in that this option indicates whether XML structures can be defined by spec document and honored by the caller.
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
XMLStructureDefinitions,
|
||||
|
||||
/**
|
||||
* Supports targeting one or more servers.
|
||||
*
|
||||
* <p>
|
||||
* That is, server is not hard-coded (although there may be a default).
|
||||
* This option is valid only for "servers" without open-ended values.
|
||||
* </p>
|
||||
*/
|
||||
@OAS3
|
||||
MultiServer,
|
||||
|
||||
/**
|
||||
* Supports targeting one or more servers, PLUS the ability to provide values for templated server parts
|
||||
*/
|
||||
@OAS3
|
||||
ParameterizedServer,
|
||||
|
||||
/**
|
||||
* Supports OAS 3.x "style" for parameters.
|
||||
*
|
||||
* <p>
|
||||
* NOTE: This option is more relevant for documentation generators which support HTML stylesheets, but may be used
|
||||
* to determine structural characteristics of a property (as with OAS 3.x lack of collectionFormat).
|
||||
* </p>
|
||||
*/
|
||||
@OAS3
|
||||
ParameterStyling,
|
||||
|
||||
/**
|
||||
* Supports OAS 3.x callbacks.
|
||||
*/
|
||||
@OAS3
|
||||
Callbacks,
|
||||
|
||||
/**
|
||||
* Supports OAS 3.x link objects, but does *NOT* suggest generated clients auto-follow links.
|
||||
*/
|
||||
@OAS3
|
||||
LinkObjects
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.meta.features;
|
||||
|
||||
import org.openapitools.codegen.meta.features.annotations.OAS2;
|
||||
import org.openapitools.codegen.meta.features.annotations.OAS3;
|
||||
|
||||
/**
|
||||
* Defines parameters supported by endpoints in the generated code.
|
||||
*/
|
||||
public enum ParameterFeature {
|
||||
/**
|
||||
* Supports path parameters.
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Path,
|
||||
|
||||
/**
|
||||
* Supports query parameters.
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Query,
|
||||
|
||||
/**
|
||||
* Supports header parameters.
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Header,
|
||||
|
||||
/**
|
||||
* Supports body parameters.
|
||||
*
|
||||
* <p>
|
||||
* OAS 3.x specification supports this structurally rather than as an "in" parameter.
|
||||
* </p>
|
||||
*/
|
||||
@OAS2
|
||||
Body,
|
||||
|
||||
/**
|
||||
* Supports form encoded parameters.
|
||||
*
|
||||
* OAS 3.x specification supports this structurally via content types rather than as an "in" parameter.
|
||||
*/
|
||||
@OAS2
|
||||
FormUnencoded,
|
||||
|
||||
/**
|
||||
* Supports multipart parameters.
|
||||
*
|
||||
* <p>OAS 3.x specification supports this structurally via content types rather than as an "in" parameter.</p>
|
||||
*/
|
||||
@OAS2
|
||||
FormMultipart,
|
||||
|
||||
/**
|
||||
* Supports Cookie parameters.
|
||||
*
|
||||
* <p>Not defined in OAS 2.0 and no tooling extensions currently supported for OAS 2.0 support.</p>
|
||||
*/
|
||||
@OAS3
|
||||
Cookie
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.meta.features;
|
||||
|
||||
import org.openapitools.codegen.meta.features.annotations.OAS2;
|
||||
import org.openapitools.codegen.meta.features.annotations.OAS3;
|
||||
|
||||
/**
|
||||
* Defines special circumstances handled by the generator.
|
||||
*/
|
||||
public enum SchemaSupportFeature {
|
||||
/**
|
||||
* Support of simple schemas (those which define properties directly).
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Simple,
|
||||
|
||||
/**
|
||||
* Support of complex schemas (those which refer to the properties of another model).
|
||||
*
|
||||
* <p>In OpenAPI Specification, this indicates support of AllOf/OneOf.</p>
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Composite,
|
||||
|
||||
/**
|
||||
* Support for polymorphic classes.
|
||||
*
|
||||
* <p>
|
||||
* This suggests Composite support, but may not always be the case and is therefore separate.
|
||||
* </p>
|
||||
*
|
||||
* <p>In OpenAPI Specification, this indicates support of AllOf with a discriminator property on the derived schema.</p>
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Polymorphism,
|
||||
|
||||
/**
|
||||
* Support for a union type.
|
||||
*
|
||||
* <p>
|
||||
* This means that a single "Type" in generated code may refer to one of any type in a set of 2 or more types.
|
||||
*
|
||||
* This is defined as a union as "OneOf" support is not explicitly limited to physical boundaries in OpenAPI Specification. The
|
||||
* implementation of such a type is easily represented dynamically (a JSON object), but requires explicit language support and
|
||||
* potentially a custom implementation (typed instances).
|
||||
*
|
||||
* Note that a generator may support "Unions" very loosely by returning an Object/Any/ref/interface{} type, leaving onus
|
||||
* on type determination to the consumer. This does *NOT* suggest generated code implements a "Union Type".
|
||||
* </p>
|
||||
*
|
||||
* <p>This suggests support of OneOf in OpenAPI Specification with a discriminator.</p>
|
||||
*/
|
||||
@OAS3
|
||||
Union
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.meta.features;
|
||||
|
||||
import org.openapitools.codegen.meta.features.annotations.OAS2;
|
||||
import org.openapitools.codegen.meta.features.annotations.OAS3;
|
||||
|
||||
/**
|
||||
* Defines security features supported in the generated code.
|
||||
*/
|
||||
public enum SecurityFeature {
|
||||
/**
|
||||
* Supports header-based basic http auth.
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
BasicAuth,
|
||||
|
||||
/**
|
||||
* Supports header-based api-key http auth.
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
ApiKey,
|
||||
|
||||
/**
|
||||
* Supports openid connect based http auth. Implies a requirement on openIdConnectUrl.
|
||||
*/
|
||||
@OAS3
|
||||
OpenIDConnect,
|
||||
|
||||
/**
|
||||
* Supports header-based bearer auth (e.g. header + bearer format).
|
||||
*/
|
||||
@OAS3
|
||||
BearerToken,
|
||||
|
||||
/**
|
||||
* Supports authorization via OAuth2 implicit flow.
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
OAuth2_Implicit,
|
||||
|
||||
/**
|
||||
* Supports authorization via OAuth2 password flow.
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
OAuth2_Password,
|
||||
|
||||
/**
|
||||
* Supports authorization via OAuth2 client credentials flow ("application" in OAS 2.0).
|
||||
*
|
||||
* <p>In OAS 2.0, this is called "application" flow.</p>
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
OAuth2_ClientCredentials,
|
||||
|
||||
/**
|
||||
* Supports authorization via OAuth2 flow ("accessCode" in OAS 2.0).
|
||||
*
|
||||
* <p>In OAS 2.0, this is called "accessCode" flow.</p>
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
OAuth2_AuthorizationCode
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.meta.features;
|
||||
|
||||
import org.openapitools.codegen.meta.features.annotations.OAS2;
|
||||
import org.openapitools.codegen.meta.features.annotations.OAS3;
|
||||
import org.openapitools.codegen.meta.features.annotations.ToolingExtension;
|
||||
|
||||
/**
|
||||
* Defines wire formats explicitly defined in spec or supported by the tool.
|
||||
*/
|
||||
public enum WireFormatFeature {
|
||||
/**
|
||||
* Supports JSON transfer
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
JSON,
|
||||
|
||||
/**
|
||||
* Supports XML transfer
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
XML,
|
||||
|
||||
/**
|
||||
* Supports protocol buffer transfer
|
||||
*/
|
||||
@ToolingExtension
|
||||
PROTOBUF,
|
||||
|
||||
/**
|
||||
* Supports other mime types or wire formats for transfer, to be documented by generators.
|
||||
*/
|
||||
@OAS2 @OAS3
|
||||
Custom
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.meta.features.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface OAS2 {
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.meta.features.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface OAS3 {
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.meta.features.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface ToolingExtension {
|
||||
}
|
@ -25,6 +25,7 @@ import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
import io.swagger.v3.oas.models.servers.ServerVariable;
|
||||
import org.openapitools.codegen.api.TemplatingEngineAdapter;
|
||||
import org.openapitools.codegen.meta.FeatureSet;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
|
||||
import java.io.File;
|
||||
@ -283,4 +284,8 @@ public interface CodegenConfig {
|
||||
boolean isStrictSpecBehavior();
|
||||
|
||||
void setStrictSpecBehavior(boolean strictSpecBehavior);
|
||||
|
||||
FeatureSet getFeatureSet();
|
||||
|
||||
void setFeatureSet(FeatureSet featureSet);
|
||||
}
|
||||
|
@ -47,8 +47,10 @@ import org.openapitools.codegen.CodegenDiscriminator.MappedModel;
|
||||
import org.openapitools.codegen.api.TemplatingEngineAdapter;
|
||||
import org.openapitools.codegen.config.GlobalSettings;
|
||||
import org.openapitools.codegen.examples.ExampleGenerator;
|
||||
import org.openapitools.codegen.meta.FeatureSet;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.serializer.SerializerUtils;
|
||||
import org.openapitools.codegen.templating.MustacheEngineAdapter;
|
||||
import org.openapitools.codegen.templating.mustache.CamelCaseLambda;
|
||||
@ -73,6 +75,54 @@ import static org.openapitools.codegen.utils.StringUtils.*;
|
||||
public class DefaultCodegen implements CodegenConfig {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultCodegen.class);
|
||||
|
||||
public static FeatureSet DefaultFeatureSet;
|
||||
|
||||
static {
|
||||
DefaultFeatureSet = FeatureSet.newBuilder()
|
||||
.includeDataTypeFeatures(
|
||||
DataTypeFeature.Int32, DataTypeFeature.Int64, DataTypeFeature.Float, DataTypeFeature.Double,
|
||||
DataTypeFeature.Decimal, DataTypeFeature.String, DataTypeFeature.Byte, DataTypeFeature.Binary,
|
||||
DataTypeFeature.Boolean, DataTypeFeature.Date, DataTypeFeature.DateTime, DataTypeFeature.Password,
|
||||
DataTypeFeature.File, DataTypeFeature.Array, DataTypeFeature.Maps, DataTypeFeature.CollectionFormat,
|
||||
DataTypeFeature.CollectionFormatMulti, DataTypeFeature.Enum, DataTypeFeature.ArrayOfEnum, DataTypeFeature.ArrayOfModel,
|
||||
DataTypeFeature.ArrayOfCollectionOfPrimitives, DataTypeFeature.ArrayOfCollectionOfModel, DataTypeFeature.ArrayOfCollectionOfEnum,
|
||||
DataTypeFeature.MapOfEnum, DataTypeFeature.MapOfModel, DataTypeFeature.MapOfCollectionOfPrimitives,
|
||||
DataTypeFeature.MapOfCollectionOfModel, DataTypeFeature.MapOfCollectionOfEnum
|
||||
// Custom types are template specific
|
||||
)
|
||||
.includeDocumentationFeatures(
|
||||
DocumentationFeature.Api, DocumentationFeature.Model
|
||||
// README is template specific
|
||||
)
|
||||
.includeGlobalFeatures(
|
||||
GlobalFeature.Host, GlobalFeature.BasePath, GlobalFeature.Info, GlobalFeature.PartialSchemes,
|
||||
GlobalFeature.Consumes, GlobalFeature.Produces, GlobalFeature.ExternalDocumentation, GlobalFeature.Examples,
|
||||
GlobalFeature.Callbacks
|
||||
// TODO: xml structures, styles, link objects, parameterized servers, full schemes for OAS 2.0
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Simple, SchemaSupportFeature.Composite,
|
||||
SchemaSupportFeature.Polymorphism
|
||||
// Union (OneOf) not 100% yet.
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Path, ParameterFeature.Query, ParameterFeature.Header, ParameterFeature.Body,
|
||||
ParameterFeature.FormUnencoded, ParameterFeature.FormMultipart, ParameterFeature.Cookie
|
||||
)
|
||||
.includeSecurityFeatures(
|
||||
SecurityFeature.BasicAuth, SecurityFeature.ApiKey, SecurityFeature.BearerToken,
|
||||
SecurityFeature.OAuth2_Implicit, SecurityFeature.OAuth2_Password,
|
||||
SecurityFeature.OAuth2_ClientCredentials, SecurityFeature.OAuth2_AuthorizationCode
|
||||
// OpenIDConnect not yet supported
|
||||
)
|
||||
.includeWireFormatFeatures(
|
||||
WireFormatFeature.JSON, WireFormatFeature.XML
|
||||
// PROTOBUF and Custom are generator specific
|
||||
)
|
||||
.build();
|
||||
}
|
||||
|
||||
protected FeatureSet featureSet;
|
||||
protected GeneratorMetadata generatorMetadata;
|
||||
protected String inputSpec;
|
||||
protected String outputFolder = "";
|
||||
@ -1112,6 +1162,9 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (codegenType == null) {
|
||||
codegenType = CodegenType.OTHER;
|
||||
}
|
||||
|
||||
featureSet = DefaultFeatureSet;
|
||||
|
||||
generatorMetadata = GeneratorMetadata.newBuilder()
|
||||
.stability(Stability.STABLE)
|
||||
.generationMessage(String.format(Locale.ROOT, "OpenAPI Generator: %s (%s)", getName(), codegenType.toValue()))
|
||||
@ -5393,4 +5446,14 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
public void setStrictSpecBehavior(final boolean strictSpecBehavior) {
|
||||
this.strictSpecBehavior = strictSpecBehavior;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureSet getFeatureSet() {
|
||||
return this.featureSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFeatureSet(final FeatureSet featureSet) {
|
||||
this.featureSet = featureSet == null ? DefaultFeatureSet : featureSet;
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -96,6 +97,27 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
|
||||
public AbstractJavaCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.noneOf(
|
||||
SecurityFeature.class
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath
|
||||
)
|
||||
.build();
|
||||
|
||||
supportsInheritance = true;
|
||||
modelTemplateFiles.put("model.mustache", ".java");
|
||||
apiTemplateFiles.put("api.mustache", ".java");
|
||||
|
@ -25,6 +25,7 @@ import io.swagger.v3.oas.models.parameters.Parameter;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -62,6 +63,26 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
|
||||
public AbstractTypeScriptClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.noneOf(
|
||||
SecurityFeature.class
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath
|
||||
)
|
||||
.build();
|
||||
|
||||
// clear import mapping (from default generator) as TS does not use it
|
||||
// at the moment
|
||||
importMapping.clear();
|
||||
|
@ -24,6 +24,7 @@ import org.openapitools.codegen.CodegenConfig;
|
||||
import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -54,6 +55,39 @@ public class AdaCodegen extends AbstractAdaCodegen implements CodegenConfig {
|
||||
@Override
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
// TODO: Ada maintainer review.
|
||||
featureSet = getFeatureSet().modify()
|
||||
.excludeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.excludeWireFormatFeatures(
|
||||
WireFormatFeature.XML,
|
||||
WireFormatFeature.PROTOBUF
|
||||
)
|
||||
.excludeSecurityFeatures(
|
||||
SecurityFeature.OpenIDConnect,
|
||||
SecurityFeature.OAuth2_Password,
|
||||
SecurityFeature.OAuth2_AuthorizationCode,
|
||||
SecurityFeature.OAuth2_ClientCredentials,
|
||||
SecurityFeature.OAuth2_Implicit,
|
||||
SecurityFeature.BearerToken,
|
||||
SecurityFeature.ApiKey
|
||||
)
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Header,
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(ClientModificationFeature.BasePath)
|
||||
.build();
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
|
||||
packageName = (String) additionalProperties.get(CodegenConstants.PACKAGE_NAME);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import org.openapitools.codegen.CodegenConfig;
|
||||
import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -33,6 +34,37 @@ public class AdaServerCodegen extends AbstractAdaCodegen implements CodegenConfi
|
||||
|
||||
public AdaServerCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: Ada maintainer review.
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.excludeWireFormatFeatures(
|
||||
WireFormatFeature.XML,
|
||||
WireFormatFeature.PROTOBUF
|
||||
)
|
||||
.excludeSecurityFeatures(
|
||||
SecurityFeature.OpenIDConnect,
|
||||
SecurityFeature.OAuth2_Password,
|
||||
SecurityFeature.OAuth2_AuthorizationCode,
|
||||
SecurityFeature.OAuth2_ClientCredentials,
|
||||
SecurityFeature.OAuth2_Implicit,
|
||||
SecurityFeature.BearerToken
|
||||
)
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Header,
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(ClientModificationFeature.BasePath)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -58,6 +59,36 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
||||
|
||||
public AndroidClientCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: Android client maintainer review.
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.excludeWireFormatFeatures(
|
||||
WireFormatFeature.PROTOBUF
|
||||
)
|
||||
.excludeSecurityFeatures(
|
||||
SecurityFeature.OpenIDConnect,
|
||||
SecurityFeature.OAuth2_Password,
|
||||
SecurityFeature.OAuth2_AuthorizationCode,
|
||||
SecurityFeature.OAuth2_ClientCredentials,
|
||||
SecurityFeature.OAuth2_Implicit,
|
||||
SecurityFeature.BearerToken
|
||||
)
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(ClientModificationFeature.BasePath)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/android";
|
||||
modelTemplateFiles.put("model.mustache", ".java");
|
||||
apiTemplateFiles.put("api.mustache", ".java");
|
||||
@ -65,6 +96,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
||||
apiPackage = "org.openapitools.client.api";
|
||||
modelPackage = "org.openapitools.client.model";
|
||||
|
||||
|
||||
setReservedWordsLowerCase(
|
||||
Arrays.asList(
|
||||
// local variable names used in API methods (endpoints)
|
||||
|
@ -18,10 +18,9 @@
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
public class Apache2ConfigCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
@ -45,6 +44,19 @@ public class Apache2ConfigCodegen extends DefaultCodegen implements CodegenConfi
|
||||
|
||||
public Apache2ConfigCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: Apache2 maintainer review.
|
||||
featureSet = getFeatureSet().modify()
|
||||
.parameterFeatures(EnumSet.of(ParameterFeature.Path))
|
||||
.securityFeatures(EnumSet.of(SecurityFeature.BasicAuth))
|
||||
.dataTypeFeatures(EnumSet.noneOf(DataTypeFeature.class))
|
||||
.wireFormatFeatures(EnumSet.noneOf(WireFormatFeature.class))
|
||||
.documentationFeatures(EnumSet.noneOf(DocumentationFeature.class))
|
||||
.globalFeatures(EnumSet.noneOf(GlobalFeature.class))
|
||||
.schemaSupportFeatures(EnumSet.noneOf(SchemaSupportFeature.class))
|
||||
.clientModificationFeatures(EnumSet.noneOf(ClientModificationFeature.class))
|
||||
.build();
|
||||
|
||||
apiTemplateFiles.put("apache-config.mustache", ".conf");
|
||||
|
||||
embeddedTemplateDir = templateDir = "apache2";
|
||||
|
@ -24,9 +24,11 @@ import java.io.Writer;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -184,6 +186,15 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
|
||||
public AsciidocDocumentationCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: Asciidoc maintainer review.
|
||||
featureSet = getFeatureSet().modify()
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.documentationFeatures(EnumSet.noneOf(DocumentationFeature.class))
|
||||
.globalFeatures(EnumSet.noneOf(GlobalFeature.class))
|
||||
.schemaSupportFeatures(EnumSet.noneOf(SchemaSupportFeature.class))
|
||||
.clientModificationFeatures(EnumSet.noneOf(ClientModificationFeature.class))
|
||||
.build();
|
||||
|
||||
LOGGER.trace("start asciidoc codegen");
|
||||
|
||||
outputFolder = "generated-code" + File.separator + "asciidoc";
|
||||
|
@ -22,6 +22,7 @@ import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.openapitools.codegen.utils.URLPathUtils;
|
||||
import org.slf4j.Logger;
|
||||
@ -87,6 +88,37 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
||||
public AspNetCoreServerCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: AspnetCore community review
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.excludeWireFormatFeatures(WireFormatFeature.PROTOBUF)
|
||||
.includeSecurityFeatures(
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.BearerToken
|
||||
)
|
||||
.excludeSecurityFeatures(
|
||||
SecurityFeature.OpenIDConnect,
|
||||
SecurityFeature.OAuth2_Password,
|
||||
SecurityFeature.OAuth2_AuthorizationCode,
|
||||
SecurityFeature.OAuth2_ClientCredentials,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
)
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling,
|
||||
GlobalFeature.MultiServer
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code" + File.separator + getName();
|
||||
|
||||
modelTemplateFiles.put("model.mustache", ".cs");
|
||||
|
@ -20,11 +20,13 @@ import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
@ -41,6 +43,20 @@ public class AvroSchemaCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
.stability(Stability.BETA)
|
||||
.build();
|
||||
|
||||
// TODO: Avro maintainer review.
|
||||
featureSet = getFeatureSet().modify()
|
||||
.parameterFeatures(EnumSet.noneOf(ParameterFeature.class))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.wireFormatFeatures(EnumSet.noneOf(WireFormatFeature.class))
|
||||
.documentationFeatures(EnumSet.noneOf(DocumentationFeature.class))
|
||||
.globalFeatures(EnumSet.noneOf(GlobalFeature.class))
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism,
|
||||
SchemaSupportFeature.Union
|
||||
)
|
||||
.clientModificationFeatures(EnumSet.noneOf(ClientModificationFeature.class))
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/avro-schema";
|
||||
modelTemplateFiles.put("model.mustache", ".avsc");
|
||||
// Force the model package to the package name so import can be fully qualified
|
||||
|
@ -29,6 +29,7 @@ import io.swagger.v3.oas.models.servers.Server;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -101,6 +102,31 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
public BashClientCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: Bash maintainer review
|
||||
featureSet = getFeatureSet().modify()
|
||||
.documentationFeatures(EnumSet.of(
|
||||
DocumentationFeature.Readme
|
||||
))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.OAuth2_Implicit,
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.BearerToken,
|
||||
SecurityFeature.ApiKey
|
||||
))
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeWireFormatFeatures(
|
||||
WireFormatFeature.JSON,
|
||||
WireFormatFeature.XML,
|
||||
WireFormatFeature.Custom
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism,
|
||||
SchemaSupportFeature.Union
|
||||
)
|
||||
.build();
|
||||
|
||||
setReservedWordsLowerCase(
|
||||
Arrays.asList(
|
||||
"case",
|
||||
|
@ -22,6 +22,7 @@ import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -49,6 +50,31 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
|
||||
public CLibcurlClientCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: c maintainer review
|
||||
// Assumes that C community considers api/model header files as documentation.
|
||||
// Generator supports Basic, OAuth, and API key explicitly. Bearer is excluded although clients are able to set headers directly.
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(
|
||||
DocumentationFeature.Readme
|
||||
)
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.OAuth2_Implicit,
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey
|
||||
))
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeWireFormatFeatures(
|
||||
WireFormatFeature.JSON,
|
||||
WireFormatFeature.XML
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism,
|
||||
SchemaSupportFeature.Union
|
||||
)
|
||||
.build();
|
||||
|
||||
modelPackage = "models";
|
||||
apiPackage = "api";
|
||||
outputFolder = "generated-code" + File.separator + "C-libcurl";
|
||||
|
@ -22,6 +22,7 @@ import com.samskivert.mustache.Mustache;
|
||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -78,6 +79,32 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
public CSharpClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.OAuth2_Implicit,
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath,
|
||||
ClientModificationFeature.UserAgent
|
||||
)
|
||||
.build();
|
||||
|
||||
supportsInheritance = true;
|
||||
modelTemplateFiles.put("model.mustache", ".cs");
|
||||
apiTemplateFiles.put("api.mustache", ".cs");
|
||||
|
@ -24,6 +24,7 @@ import org.openapitools.codegen.SupportingFile;
|
||||
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -40,6 +41,10 @@ public class CSharpDotNet2ClientCodegen extends AbstractCSharpCodegen {
|
||||
public CSharpDotNet2ClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||
.stability(Stability.DEPRECATED)
|
||||
.build();
|
||||
|
@ -22,6 +22,7 @@ import com.google.common.collect.*;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.openapitools.codegen.utils.URLPathUtils;
|
||||
import org.slf4j.Logger;
|
||||
@ -66,6 +67,25 @@ public class CSharpNancyFXServerCodegen extends AbstractCSharpCodegen {
|
||||
private boolean asyncServer = false;
|
||||
|
||||
public CSharpNancyFXServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.excludeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code" + File.separator + getName();
|
||||
apiTemplateFiles.put("api.mustache", ".cs");
|
||||
|
||||
|
@ -21,6 +21,7 @@ import com.samskivert.mustache.Mustache;
|
||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -83,6 +84,31 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
||||
public CSharpNetCoreClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.OAuth2_Implicit,
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath,
|
||||
ClientModificationFeature.UserAgent
|
||||
)
|
||||
.build();
|
||||
|
||||
// mapped non-nullable type without ?
|
||||
typeMapping = new HashMap<String, String>();
|
||||
typeMapping.put("string", "string");
|
||||
|
@ -25,6 +25,7 @@ import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
|
||||
import java.io.File;
|
||||
@ -56,6 +57,26 @@ public class ClojureClientCodegen extends DefaultCodegen implements CodegenConfi
|
||||
|
||||
public ClojureClientCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: Clojure maintainer review
|
||||
featureSet = getFeatureSet().modify()
|
||||
.excludeDocumentationFeatures(
|
||||
DocumentationFeature.Readme
|
||||
)
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.OAuth2_Implicit,
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey
|
||||
))
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism,
|
||||
SchemaSupportFeature.Union
|
||||
)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code" + File.separator + "clojure";
|
||||
modelTemplateFiles.put("spec.mustache", ".clj");
|
||||
apiTemplateFiles.put("api.mustache", ".clj");
|
||||
|
@ -20,6 +20,7 @@ package org.openapitools.codegen.languages;
|
||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
|
||||
import java.util.*;
|
||||
@ -33,6 +34,23 @@ public class ConfluenceWikiCodegen extends DefaultCodegen implements CodegenConf
|
||||
|
||||
public ConfluenceWikiCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: ConfluenceWiki maintainer review
|
||||
featureSet = getFeatureSet().modify()
|
||||
.documentationFeatures(EnumSet.noneOf(DocumentationFeature.class))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeParameterFeatures(ParameterFeature.Cookie)
|
||||
.includeWireFormatFeatures(
|
||||
WireFormatFeature.JSON,
|
||||
WireFormatFeature.XML,
|
||||
WireFormatFeature.Custom
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism,
|
||||
SchemaSupportFeature.Union
|
||||
)
|
||||
.build();
|
||||
|
||||
outputFolder = "docs";
|
||||
embeddedTemplateDir = templateDir = "confluenceWikiDocs";
|
||||
|
||||
|
@ -22,17 +22,15 @@ import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import io.swagger.v3.oas.models.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.openapitools.codegen.utils.URLPathUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.net.URL;
|
||||
|
||||
import static org.openapitools.codegen.utils.StringUtils.*;
|
||||
|
||||
@ -67,6 +65,26 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
|
||||
|
||||
public CppPistacheServerCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: cpp-pistache-server maintainer review
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling,
|
||||
GlobalFeature.MultiServer
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
if (StringUtils.isEmpty(modelNamePrefix)) {
|
||||
modelNamePrefix = PREFIX;
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.CodegenModel;
|
||||
import org.openapitools.codegen.CodegenOperation;
|
||||
import org.openapitools.codegen.CodegenParameter;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
|
||||
import java.io.File;
|
||||
@ -29,6 +30,25 @@ public class CppQt5AbstractCodegen extends AbstractCppCodegen implements Codegen
|
||||
|
||||
public CppQt5AbstractCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.excludeWireFormatFeatures(WireFormatFeature.PROTOBUF)
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling,
|
||||
GlobalFeature.MultiServer
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
// set modelNamePrefix as default for QHttpEngine Server
|
||||
if (StringUtils.isEmpty(modelNamePrefix)) {
|
||||
modelNamePrefix = PREFIX;
|
||||
|
@ -23,6 +23,7 @@ import io.swagger.v3.oas.models.servers.Server;
|
||||
import org.openapitools.codegen.CodegenConfig;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
import org.openapitools.codegen.utils.URLPathUtils;
|
||||
|
||||
import java.io.File;
|
||||
@ -43,6 +44,10 @@ public class CppQt5QHttpEngineServerCodegen extends CppQt5AbstractCodegen implem
|
||||
public CppQt5QHttpEngineServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
// set the output folder here
|
||||
outputFolder = "generated-code/cpp-qt5-qhttpengine-server";
|
||||
|
||||
|
@ -26,12 +26,12 @@ import io.swagger.v3.oas.models.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static com.google.common.base.Strings.isNullOrEmpty;
|
||||
import static org.openapitools.codegen.utils.StringUtils.*;
|
||||
|
||||
public class CppRestSdkClientCodegen extends AbstractCppCodegen {
|
||||
|
||||
@ -79,6 +79,29 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen {
|
||||
public CppRestSdkClientCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: cpp-restsdk maintainer review
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.OAuth2_Implicit,
|
||||
SecurityFeature.ApiKey
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling,
|
||||
GlobalFeature.MultiServer
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
apiPackage = "org.openapitools.client.api";
|
||||
modelPackage = "org.openapitools.client.model";
|
||||
|
||||
|
@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -44,6 +45,25 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen {
|
||||
public CppRestbedServerCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: cpp-restbed-server maintainer review
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling,
|
||||
GlobalFeature.MultiServer
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
apiPackage = "org.openapitools.server.api";
|
||||
modelPackage = "org.openapitools.server.model";
|
||||
|
||||
|
@ -23,10 +23,12 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.CodegenConfig;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
@ -39,6 +41,28 @@ public class CppTizenClientCodegen extends AbstractCppCodegen implements Codegen
|
||||
|
||||
public CppTizenClientCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: cpp-tizen maintainer review
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BearerToken
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling,
|
||||
GlobalFeature.MultiServer
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
outputFolder = "";
|
||||
modelTemplateFiles.put("model-header.mustache", ".h");
|
||||
modelTemplateFiles.put("model-body.mustache", ".cpp");
|
||||
|
@ -22,6 +22,7 @@ import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -36,37 +37,6 @@ import java.util.*;
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||
|
||||
// import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
// import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||
|
||||
// import java.io.BufferedReader;
|
||||
// import java.io.File;
|
||||
// import java.io.FileInputStream;
|
||||
// import java.io.InputStreamReader;
|
||||
// import java.nio.charset.Charset;
|
||||
// import java.util.ArrayList;
|
||||
// import java.util.Arrays;
|
||||
// import java.util.HashMap;
|
||||
// import java.util.HashSet;
|
||||
// import java.util.List;
|
||||
// import java.util.Map;
|
||||
// import java.util.Set;
|
||||
|
||||
// import javax.xml.validation.Schema;
|
||||
|
||||
// import org.apache.commons.io.FilenameUtils;
|
||||
// import org.openapitools.codegen.CodegenConfig;
|
||||
// import org.openapitools.codegen.CodegenConstants;
|
||||
// import org.openapitools.codegen.CodegenModel;
|
||||
// import org.openapitools.codegen.CodegenProperty;
|
||||
// import org.openapitools.codegen.CodegenType;
|
||||
// import org.openapitools.codegen.DefaultCodegen;
|
||||
// import org.openapitools.codegen.utils.ModelUtils;
|
||||
// import org.openapitools.codegen.utils.StringUtils;
|
||||
// import org.slf4j.LoggerFactory;
|
||||
|
||||
// import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
|
||||
public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(DartClientCodegen.class);
|
||||
|
||||
@ -96,6 +66,30 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
public DartClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.OAuth2_Implicit,
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath
|
||||
)
|
||||
.build();
|
||||
|
||||
// clear import mapping (from default generator) as dart does not use it at the moment
|
||||
importMapping.clear();
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
|
||||
import io.swagger.v3.oas.models.media.*;
|
||||
@ -56,6 +57,31 @@ public class DartJaguarClientCodegen extends DartClientCodegen {
|
||||
|
||||
public DartJaguarClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.OAuth2_Implicit,
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath
|
||||
)
|
||||
.build();
|
||||
|
||||
browserClient = false;
|
||||
outputFolder = "generated-code/dart-jaguar";
|
||||
embeddedTemplateDir = templateDir = "dart-jaguar";
|
||||
|
@ -21,10 +21,12 @@ import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.CodegenProperty;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
|
||||
@ -58,6 +60,32 @@ public class EiffelClientCodegen extends AbstractEiffelCodegen {
|
||||
|
||||
public EiffelClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.OAuth2_Implicit,
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath,
|
||||
ClientModificationFeature.UserAgent
|
||||
)
|
||||
.build();
|
||||
|
||||
uuid = UUID.randomUUID();
|
||||
uuidTest = UUID.randomUUID();
|
||||
outputFolder = "generated-code/Eiffel";
|
||||
|
@ -26,6 +26,7 @@ import io.swagger.v3.oas.models.media.Schema;
|
||||
import io.swagger.v3.oas.models.responses.ApiResponse;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -60,6 +61,29 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
public ElixirClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.OAuth2_Implicit,
|
||||
SecurityFeature.BasicAuth
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath
|
||||
)
|
||||
.build();
|
||||
|
||||
// set the output folder here
|
||||
outputFolder = "generated-code/elixir";
|
||||
|
||||
|
@ -23,6 +23,7 @@ import io.swagger.v3.oas.models.responses.ApiResponse;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -69,6 +70,28 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
public ElmClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath
|
||||
)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/elm";
|
||||
modelTemplateFiles.put("model.mustache", ".elm");
|
||||
templateDir = "elm";
|
||||
|
@ -21,6 +21,7 @@ import com.samskivert.mustache.Mustache;
|
||||
import com.samskivert.mustache.Template;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.templating.mustache.JoinWithCommaLambda;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -56,6 +57,28 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
|
||||
public ErlangClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
|
||||
.securityFeatures(EnumSet.of(SecurityFeature.ApiKey))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath
|
||||
)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/erlang";
|
||||
modelTemplateFiles.put("model.mustache", ".erl");
|
||||
apiTemplateFiles.put("api.mustache", ".erl");
|
||||
|
@ -21,6 +21,7 @@ import com.samskivert.mustache.Template;
|
||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -58,6 +59,31 @@ public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig
|
||||
|
||||
public ErlangProperCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.BasicAuth
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath
|
||||
)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/erlang";
|
||||
modelTemplateFiles.put("model.mustache", ".erl");
|
||||
apiTemplateFiles.put("api.mustache", "_api.erl");
|
||||
|
@ -18,11 +18,13 @@
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -41,6 +43,27 @@ public class ErlangServerCodegen extends DefaultCodegen implements CodegenConfig
|
||||
public ErlangServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
// set the output folder here
|
||||
outputFolder = "generated-code/erlang-server";
|
||||
|
||||
|
@ -20,12 +20,14 @@ package org.openapitools.codegen.languages;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
|
||||
@ -44,6 +46,29 @@ public class FlashClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
public FlashClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.ApiKey
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath
|
||||
)
|
||||
.build();
|
||||
|
||||
modelPackage = "org.openapitools.client.model";
|
||||
apiPackage = "org.openapitools.client.api";
|
||||
outputFolder = "generated-code" + File.separatorChar + "flash";
|
||||
|
@ -29,6 +29,7 @@ import java.util.*;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -52,6 +53,29 @@ public class FsharpFunctionsServerCodegen extends AbstractFSharpCodegen {
|
||||
public FsharpFunctionsServerCodegen() {
|
||||
super();
|
||||
|
||||
// TODO: There's a README.mustache, but it doesn't seem to be referenced…
|
||||
featureSet = getFeatureSet().modify()
|
||||
// .includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
|
||||
.securityFeatures(EnumSet.noneOf(
|
||||
SecurityFeature.class
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling,
|
||||
GlobalFeature.BasePath,
|
||||
GlobalFeature.Host
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||
.stability(Stability.BETA)
|
||||
.build();
|
||||
@ -115,8 +139,6 @@ public class FsharpFunctionsServerCodegen extends AbstractFSharpCodegen {
|
||||
supportingFiles.add(new SupportingFile("host.json", "", "host.json"));
|
||||
supportingFiles.add(new SupportingFile("local.settings.json", "", "local.settings.json"));
|
||||
supportingFiles.add(new SupportingFile("Project.fsproj.mustache", projectFolder, packageName + ".fsproj"));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -25,6 +25,7 @@ import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
import org.openapitools.codegen.utils.URLPathUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -60,6 +61,9 @@ public class FsharpGiraffeServerCodegen extends AbstractFSharpCodegen {
|
||||
|
||||
public FsharpGiraffeServerCodegen() {
|
||||
super();
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||
.stability(Stability.BETA)
|
||||
|
@ -21,10 +21,12 @@ import org.openapitools.codegen.CliOption;
|
||||
import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.EnumSet;
|
||||
|
||||
public class GoClientCodegen extends AbstractGoCodegen {
|
||||
|
||||
@ -42,6 +44,32 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
||||
public GoClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath,
|
||||
ClientModificationFeature.UserAgent
|
||||
)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/go";
|
||||
modelTemplateFiles.put("model.mustache", ".go");
|
||||
apiTemplateFiles.put("api.mustache", ".go");
|
||||
|
@ -20,11 +20,13 @@ import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.CodegenOperation;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -40,6 +42,26 @@ public class GoGinServerCodegen extends AbstractGoCodegen {
|
||||
public GoGinServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.noneOf(
|
||||
SecurityFeature.class
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
// set the output folder here
|
||||
outputFolder = "generated-code/go";
|
||||
|
||||
|
@ -23,11 +23,13 @@ import org.openapitools.codegen.CodegenOperation;
|
||||
import org.openapitools.codegen.CodegenParameter;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -45,6 +47,26 @@ public class GoServerCodegen extends AbstractGoCodegen {
|
||||
public GoServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.noneOf(
|
||||
SecurityFeature.class
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
// set the output folder here
|
||||
outputFolder = "generated-code/go";
|
||||
|
||||
|
@ -20,11 +20,13 @@ import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.EnumSet;
|
||||
|
||||
public class GraphQLNodeJSExpressServerCodegen extends AbstractGraphQLCodegen implements CodegenConfig {
|
||||
|
||||
@ -48,6 +50,26 @@ public class GraphQLNodeJSExpressServerCodegen extends AbstractGraphQLCodegen im
|
||||
public GraphQLNodeJSExpressServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
|
||||
.securityFeatures(EnumSet.noneOf(
|
||||
SecurityFeature.class
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
packageName = "openapi3graphql-server";
|
||||
packageVersion = "1.0.0";
|
||||
|
||||
|
@ -20,9 +20,12 @@ import org.openapitools.codegen.CliOption;
|
||||
import org.openapitools.codegen.CodegenConfig;
|
||||
import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
public class GraphQLSchemaCodegen extends AbstractGraphQLCodegen implements CodegenConfig {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(GraphQLSchemaCodegen.class);
|
||||
@ -42,6 +45,24 @@ public class GraphQLSchemaCodegen extends AbstractGraphQLCodegen implements Code
|
||||
|
||||
public GraphQLSchemaCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
// .includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
|
||||
.securityFeatures(EnumSet.noneOf(
|
||||
SecurityFeature.class
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/graphql-schema";
|
||||
modelTemplateFiles.put("model.mustache", ".graphql");
|
||||
apiTemplateFiles.put("api.mustache", ".graphql");
|
||||
|
@ -18,8 +18,10 @@
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -31,6 +33,27 @@ public class GroovyClientCodegen extends AbstractJavaCodegen {
|
||||
public GroovyClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath
|
||||
)
|
||||
.build();
|
||||
|
||||
// avoid importing the following as models
|
||||
languageSpecificPrimitives.add("Date");
|
||||
languageSpecificPrimitives.add("ArrayList");
|
||||
|
@ -27,6 +27,7 @@ import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -145,6 +146,32 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
public HaskellHttpClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath,
|
||||
ClientModificationFeature.UserAgent
|
||||
)
|
||||
.build();
|
||||
|
||||
this.prependFormOrBodyParameters = true;
|
||||
|
||||
// override the mapping to keep the original mapping in Haskell
|
||||
|
@ -25,6 +25,7 @@ import io.swagger.v3.oas.models.servers.Server;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -79,6 +80,28 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
|
||||
public HaskellServantCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
// override the mapping to keep the original mapping in Haskell
|
||||
specialCharReplacements.put("-", "Dash");
|
||||
specialCharReplacements.put(">", "GreaterThan");
|
||||
|
@ -25,10 +25,12 @@ import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.openapitools.codegen.CodegenConfig;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.DefaultCodegen;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
|
||||
public class JMeterClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
@ -73,6 +75,30 @@ public class JMeterClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
public JMeterClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath
|
||||
)
|
||||
.build();
|
||||
|
||||
// set the output folder here
|
||||
outputFolder = "generated-code/JMeterClientCodegen";
|
||||
|
||||
|
@ -23,8 +23,8 @@ import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
|
||||
import org.openapitools.codegen.languages.features.GzipFeatures;
|
||||
import org.openapitools.codegen.languages.features.PerformBeanValidationFeatures;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
import org.openapitools.codegen.templating.mustache.CaseFormatLambda;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.openapitools.codegen.utils.ProcessUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -106,6 +106,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
public JavaClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code" + File.separator + "java";
|
||||
embeddedTemplateDir = templateDir = "Java";
|
||||
invokerPackage = "org.openapitools.client";
|
||||
|
@ -22,6 +22,7 @@ import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.config.GlobalSettings;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -40,6 +41,10 @@ public class JavaInflectorServerCodegen extends AbstractJavaCodegen {
|
||||
public JavaInflectorServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
sourceFolder = "src/gen/java";
|
||||
apiTestTemplateFiles.clear(); // TODO: add test template
|
||||
embeddedTemplateDir = templateDir = "JavaInflector";
|
||||
|
@ -17,23 +17,19 @@
|
||||
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
|
||||
import io.swagger.v3.oas.models.Operation;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.CliOption;
|
||||
import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.CodegenModel;
|
||||
import org.openapitools.codegen.CodegenOperation;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
|
||||
public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
||||
|
||||
public static final String INTERFACE_ONLY = "interfaceOnly";
|
||||
@ -59,6 +55,11 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
||||
|
||||
public JavaJAXRSSpecServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
invokerPackage = "org.openapitools.api";
|
||||
artifactId = "openapi-jaxrs-server";
|
||||
outputFolder = "generated-code/JavaJaxRS-Spec";
|
||||
|
@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.Operation;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@ -40,6 +41,10 @@ public class JavaJerseyServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
||||
public JavaJerseyServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/JavaJaxRS-Jersey";
|
||||
|
||||
apiTemplateFiles.put("apiService.mustache", ".java");
|
||||
|
@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.Operation;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@ -37,6 +38,11 @@ public class JavaMSF4JServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
||||
|
||||
public JavaMSF4JServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/JavaJaxRS-MSF4J";
|
||||
apiTemplateFiles.put("apiService.mustache", ".java");
|
||||
apiTemplateFiles.put("apiServiceImpl.mustache", ".java");
|
||||
|
@ -22,6 +22,7 @@ import io.swagger.v3.oas.models.Operation;
|
||||
import io.swagger.v3.oas.models.PathItem;
|
||||
import io.swagger.v3.oas.models.tags.Tag;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
import org.openapitools.codegen.utils.URLPathUtils;
|
||||
|
||||
import java.io.File;
|
||||
@ -53,6 +54,10 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen {
|
||||
public JavaPKMSTServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
groupId = "com.prokarma";
|
||||
artifactId = "pkmst-microservice";
|
||||
embeddedTemplateDir = templateDir = "java-pkmst";
|
||||
|
@ -20,6 +20,7 @@ package org.openapitools.codegen.languages;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
@ -53,6 +54,11 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea
|
||||
|
||||
public JavaPlayFrameworkCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/javaPlayFramework";
|
||||
apiTestTemplateFiles.clear();
|
||||
embeddedTemplateDir = templateDir = "JavaPlayFramework";
|
||||
|
@ -24,6 +24,7 @@ import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
|
||||
import org.openapitools.codegen.languages.features.JbossFeature;
|
||||
import org.openapitools.codegen.languages.features.SwaggerFeatures;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@ -38,9 +39,12 @@ public class JavaResteasyEapServerCodegen extends AbstractJavaJAXRSServerCodegen
|
||||
protected boolean useSwaggerFeature = false;
|
||||
|
||||
public JavaResteasyEapServerCodegen() {
|
||||
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
artifactId = "openapi-jaxrs-resteasy-eap-server";
|
||||
useBeanValidation = true;
|
||||
outputFolder = "generated-code/JavaJaxRS-Resteasy-eap";
|
||||
|
@ -22,6 +22,7 @@ import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.languages.features.JbossFeature;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@ -34,9 +35,12 @@ public class JavaResteasyServerCodegen extends AbstractJavaJAXRSServerCodegen im
|
||||
protected boolean generateJbossDeploymentDescriptor = true;
|
||||
|
||||
public JavaResteasyServerCodegen() {
|
||||
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
artifactId = "openapi-jaxrs-resteasy-server";
|
||||
outputFolder = "generated-code/JavaJaxRS-Resteasy";
|
||||
|
||||
|
@ -20,6 +20,7 @@ package org.openapitools.codegen.languages;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.config.GlobalSettings;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -41,6 +42,10 @@ public class JavaUndertowServerCodegen extends AbstractJavaCodegen {
|
||||
public JavaUndertowServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
embeddedTemplateDir = templateDir = "java-undertow-server";
|
||||
invokerPackage = "org.openapitools.handler";
|
||||
artifactId = "openapi-undertow-server";
|
||||
|
@ -24,6 +24,7 @@ import io.swagger.v3.oas.models.PathItem.HttpMethod;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
import org.openapitools.codegen.utils.URLPathUtils;
|
||||
|
||||
import java.io.File;
|
||||
@ -58,6 +59,10 @@ public class JavaVertXServerCodegen extends AbstractJavaCodegen {
|
||||
public JavaVertXServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
// set the output folder here
|
||||
outputFolder = "generated-code" + File.separator + "javaVertXServer";
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.info.License;
|
||||
@ -26,6 +25,7 @@ import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -92,6 +92,11 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
|
||||
public JavascriptClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/js";
|
||||
modelTemplateFiles.put("model.mustache", ".js");
|
||||
modelTestTemplateFiles.put("model_test.mustache", ".js");
|
||||
|
@ -19,14 +19,12 @@ package org.openapitools.codegen.languages;
|
||||
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import static org.openapitools.codegen.utils.StringUtils.dashize;
|
||||
@ -39,6 +37,10 @@ public class JavascriptFlowtypedClientCodegen extends AbstractTypeScriptClientCo
|
||||
public JavascriptFlowtypedClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
// clear import mapping (from default generator) as TS does not use it
|
||||
// at the moment
|
||||
importMapping.clear();
|
||||
|
@ -25,6 +25,7 @@ import org.openapitools.codegen.CodegenParameter;
|
||||
import org.openapitools.codegen.CodegenProperty;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
@ -95,6 +96,34 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
|
||||
public KotlinClientCodegen() {
|
||||
super();
|
||||
|
||||
/*
|
||||
* OAuth flows supported _only_ by client explicitly setting bearer token. The "flows" are not supported.
|
||||
*/
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.excludeWireFormatFeatures(WireFormatFeature.XML, WireFormatFeature.PROTOBUF)
|
||||
.excludeSecurityFeatures(
|
||||
SecurityFeature.OpenIDConnect,
|
||||
SecurityFeature.OAuth2_Password,
|
||||
SecurityFeature.OAuth2_AuthorizationCode,
|
||||
SecurityFeature.OAuth2_ClientCredentials,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
)
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(ClientModificationFeature.BasePath)
|
||||
.build();
|
||||
|
||||
artifactId = "kotlin-client";
|
||||
packageName = "org.openapitools.client";
|
||||
|
||||
|
@ -23,11 +23,13 @@ import org.openapitools.codegen.CliOption;
|
||||
import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -58,6 +60,28 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen {
|
||||
public KotlinServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
artifactId = "kotlin-server";
|
||||
packageName = "org.openapitools.server";
|
||||
|
||||
|
@ -26,6 +26,7 @@ import io.swagger.v3.oas.models.Operation;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.URLPathUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -84,6 +85,28 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
||||
public KotlinSpringServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
reservedWords.addAll(VARIABLE_RESERVED_WORDS);
|
||||
|
||||
outputFolder = "generated-code/kotlin-spring";
|
||||
|
@ -21,11 +21,12 @@ import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Locale;
|
||||
import java.util.EnumSet;
|
||||
|
||||
public class KotlinVertxServerCodegen extends AbstractKotlinCodegen {
|
||||
|
||||
@ -53,6 +54,26 @@ public class KotlinVertxServerCodegen extends AbstractKotlinCodegen {
|
||||
public KotlinVertxServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.noneOf(
|
||||
SecurityFeature.class
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||
.stability(Stability.BETA)
|
||||
.build();
|
||||
|
@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -55,6 +56,29 @@ public class LuaClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
public LuaClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/lua";
|
||||
modelTemplateFiles.put("model.mustache", ".lua");
|
||||
apiTemplateFiles.put("api.mustache", ".lua");
|
||||
|
@ -17,6 +17,7 @@
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -61,6 +62,21 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig
|
||||
public MysqlSchemaCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.noneOf(WireFormatFeature.class))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.clientModificationFeatures(EnumSet.noneOf(ClientModificationFeature.class))
|
||||
.build();
|
||||
// clear import mapping (from default generator) as mysql does not use import directives
|
||||
importMapping.clear();
|
||||
|
||||
|
@ -22,6 +22,7 @@ import io.swagger.v3.oas.models.media.StringSchema;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.openapitools.codegen.utils.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
@ -31,7 +32,6 @@ import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||
|
||||
public class NimClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
static Logger LOGGER = LoggerFactory.getLogger(NimClientCodegen.class);
|
||||
@ -56,6 +56,28 @@ public class NimClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
public NimClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath,
|
||||
ClientModificationFeature.UserAgent
|
||||
)
|
||||
.build();
|
||||
|
||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||
.stability(Stability.BETA)
|
||||
.build();
|
||||
|
@ -28,6 +28,7 @@ import io.swagger.v3.oas.models.info.Info;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.URLPathUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -36,7 +37,6 @@ import java.io.File;
|
||||
import java.net.URL;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.openapitools.codegen.utils.StringUtils.*;
|
||||
|
||||
@ -55,6 +55,26 @@ public class NodeJSExpressServerCodegen extends DefaultCodegen implements Codege
|
||||
public NodeJSExpressServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||
.stability(Stability.BETA)
|
||||
.build();
|
||||
|
@ -30,6 +30,7 @@ import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.config.GlobalSettings;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.URLPathUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -60,6 +61,24 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig
|
||||
public NodeJSServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
// mark the generator as deprecated in the documentation
|
||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||
.stability(Stability.DEPRECATED)
|
||||
|
@ -25,6 +25,7 @@ import io.swagger.v3.oas.models.responses.ApiResponse;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -72,6 +73,28 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
|
||||
public OCamlClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.ApiKey
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath
|
||||
)
|
||||
.build();
|
||||
|
||||
|
||||
outputFolder = "generated-code/ocaml";
|
||||
modelTemplateFiles.put("model.mustache", ".ml");
|
||||
|
||||
|
@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -63,6 +64,30 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
public ObjcClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath,
|
||||
ClientModificationFeature.UserAgent
|
||||
)
|
||||
.build();
|
||||
|
||||
supportsInheritance = true;
|
||||
outputFolder = "generated-code" + File.separator + "objc";
|
||||
modelTemplateFiles.put("model-header.mustache", ".h");
|
||||
|
@ -23,11 +23,13 @@ import org.openapitools.codegen.CodegenConfig;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.DefaultCodegen;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.serializer.SerializerUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.EnumSet;
|
||||
|
||||
public class OpenAPIGenerator extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
@ -35,6 +37,17 @@ public class OpenAPIGenerator extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
public OpenAPIGenerator() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.documentationFeatures(EnumSet.allOf(DocumentationFeature.class))
|
||||
.dataTypeFeatures(EnumSet.allOf(DataTypeFeature.class))
|
||||
.wireFormatFeatures(EnumSet.allOf(WireFormatFeature.class))
|
||||
.securityFeatures(EnumSet.allOf(SecurityFeature.class))
|
||||
.globalFeatures(EnumSet.allOf(GlobalFeature.class))
|
||||
.parameterFeatures(EnumSet.allOf(ParameterFeature.class))
|
||||
.schemaSupportFeatures(EnumSet.allOf(SchemaSupportFeature.class))
|
||||
.build();
|
||||
|
||||
embeddedTemplateDir = templateDir = "openapi";
|
||||
outputFolder = "generated-code/openapi";
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.templating.mustache.OnChangeLambda;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -28,6 +29,7 @@ import com.samskivert.mustache.Mustache.Lambda;
|
||||
import io.swagger.v3.oas.models.Operation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -40,6 +42,17 @@ public class OpenAPIYamlGenerator extends DefaultCodegen implements CodegenConfi
|
||||
|
||||
public OpenAPIYamlGenerator() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.documentationFeatures(EnumSet.allOf(DocumentationFeature.class))
|
||||
.dataTypeFeatures(EnumSet.allOf(DataTypeFeature.class))
|
||||
.wireFormatFeatures(EnumSet.allOf(WireFormatFeature.class))
|
||||
.securityFeatures(EnumSet.allOf(SecurityFeature.class))
|
||||
.globalFeatures(EnumSet.allOf(GlobalFeature.class))
|
||||
.parameterFeatures(EnumSet.allOf(ParameterFeature.class))
|
||||
.schemaSupportFeatures(EnumSet.allOf(SchemaSupportFeature.class))
|
||||
.build();
|
||||
|
||||
embeddedTemplateDir = templateDir = "openapi-yaml";
|
||||
outputFolder = "generated-code/openapi-yaml";
|
||||
cliOptions.add(CliOption.newString(OUTPUT_NAME, "Output filename").defaultValue(outputFile));
|
||||
|
@ -22,12 +22,14 @@ import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
@ -49,6 +51,30 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
public PerlClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.BearerToken,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.includeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath,
|
||||
ClientModificationFeature.UserAgent
|
||||
)
|
||||
.build();
|
||||
|
||||
// add multiple inheritance support (beta)
|
||||
supportsMultipleInheritance = true;
|
||||
|
||||
|
@ -22,12 +22,14 @@ import org.openapitools.codegen.CliOption;
|
||||
import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
public class PhpClientCodegen extends AbstractPhpCodegen {
|
||||
@ -37,6 +39,21 @@ public class PhpClientCodegen extends AbstractPhpCodegen {
|
||||
public PhpClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.build();
|
||||
|
||||
// clear import mapping (from default generator) as php does not use it
|
||||
// at the moment
|
||||
importMapping.clear();
|
||||
|
@ -20,6 +20,7 @@ package org.openapitools.codegen.languages;
|
||||
import org.openapitools.codegen.CodegenOperation;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
@ -65,6 +66,21 @@ public class PhpLaravelServerCodegen extends AbstractPhpCodegen {
|
||||
public PhpLaravelServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.build();
|
||||
|
||||
embeddedTemplateDir = templateDir = "php-laravel";
|
||||
variableNamingConvention = "camelCase";
|
||||
|
||||
|
@ -20,6 +20,7 @@ package org.openapitools.codegen.languages;
|
||||
import org.openapitools.codegen.CodegenOperation;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
@ -61,6 +62,21 @@ public class PhpLumenServerCodegen extends AbstractPhpCodegen {
|
||||
public PhpLumenServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.build();
|
||||
|
||||
embeddedTemplateDir = templateDir = "php-lumen";
|
||||
|
||||
/*
|
||||
|
@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
|
||||
import java.io.File;
|
||||
@ -38,6 +39,21 @@ public class PhpSilexServerCodegen extends DefaultCodegen implements CodegenConf
|
||||
public PhpSilexServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.build();
|
||||
|
||||
invokerPackage = camelize("OpenAPIServer");
|
||||
String packageName = "OpenAPIServer";
|
||||
modelPackage = "lib" + File.separator + "models";
|
||||
|
@ -25,6 +25,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -48,6 +49,21 @@ public class PhpSlimServerCodegen extends AbstractPhpCodegen {
|
||||
public PhpSlimServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.build();
|
||||
|
||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||
.stability(Stability.DEPRECATED)
|
||||
.build();
|
||||
|
@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -80,6 +81,21 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg
|
||||
public PhpSymfonyServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.build();
|
||||
|
||||
// clear import mapping (from default generator) as php does not use it
|
||||
// at the moment
|
||||
importMapping.clear();
|
||||
|
@ -25,6 +25,7 @@ import io.swagger.v3.oas.models.media.*;
|
||||
import io.swagger.v3.oas.models.parameters.Parameter;
|
||||
import io.swagger.v3.oas.models.parameters.QueryParameter;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -57,6 +58,22 @@ public class PhpZendExpressivePathHandlerServerCodegen extends AbstractPhpCodege
|
||||
|
||||
public PhpZendExpressivePathHandlerServerCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.build();
|
||||
|
||||
//no point to use double - http://php.net/manual/en/language.types.float.php , especially because of PHP 7+ float type declaration
|
||||
typeMapping.put("double", "float");
|
||||
|
||||
|
@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.openapitools.codegen.utils.ProcessUtils;
|
||||
import org.slf4j.Logger;
|
||||
@ -49,6 +50,28 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
public PowerShellClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code" + File.separator + "powershell";
|
||||
modelTemplateFiles.put("model.mustache", ".ps1");
|
||||
apiTemplateFiles.put("api.mustache", ".ps1");
|
||||
|
@ -19,13 +19,15 @@ package org.openapitools.codegen.languages;
|
||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
|
||||
import org.openapitools.codegen.CliOption;
|
||||
import org.openapitools.codegen.CodegenConfig;
|
||||
import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
import org.openapitools.codegen.meta.features.SecurityFeature;
|
||||
import org.openapitools.codegen.meta.features.WireFormatFeature;
|
||||
import org.openapitools.codegen.utils.ProcessUtils;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
|
||||
@ -67,6 +69,13 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf
|
||||
.stability(Stability.BETA)
|
||||
.build();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.includeWireFormatFeatures(WireFormatFeature.PROTOBUF)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.PROTOBUF))
|
||||
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/protobuf-schema";
|
||||
modelTemplateFiles.put("model.mustache", ".proto");
|
||||
apiTemplateFiles.put("api.mustache", ".proto");
|
||||
|
@ -32,6 +32,7 @@ import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -63,6 +64,11 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme
|
||||
|
||||
public PythonAbstractConnexionServerCodegen(String templateDirectory, boolean fixBodyNameValue) {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.build();
|
||||
|
||||
fixBodyName = fixBodyNameValue;
|
||||
modelPackage = "models";
|
||||
testPackage = "test";
|
||||
|
@ -16,14 +16,41 @@
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
public class PythonAiohttpConnexionServerCodegen extends PythonAbstractConnexionServerCodegen {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(PythonAiohttpConnexionServerCodegen.class);
|
||||
|
||||
public PythonAiohttpConnexionServerCodegen() {
|
||||
super("python-aiohttp", true);
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.BearerToken,
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
testPackage = "tests";
|
||||
embeddedTemplateDir = templateDir = "python-aiohttp";
|
||||
}
|
||||
|
@ -17,10 +17,12 @@ package org.openapitools.codegen.languages;
|
||||
|
||||
import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.EnumSet;
|
||||
|
||||
public class PythonBluePlanetServerCodegen extends PythonAbstractConnexionServerCodegen {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(PythonBluePlanetServerCodegen.class);
|
||||
@ -30,6 +32,30 @@ public class PythonBluePlanetServerCodegen extends PythonAbstractConnexionServer
|
||||
|
||||
public PythonBluePlanetServerCodegen() {
|
||||
super("python-blueplanet", true);
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.BearerToken,
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
testPackage = "tests";
|
||||
embeddedTemplateDir = templateDir = "python-blueplanet";
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ import io.swagger.v3.oas.models.parameters.Parameter;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -58,6 +59,29 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
public PythonClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.BearerToken,
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
// clear import mapping (from default generator) as python does not use it
|
||||
// at the moment
|
||||
importMapping.clear();
|
||||
|
@ -29,6 +29,7 @@ import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.examples.ExampleGenerator;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
@ -50,8 +51,32 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen {
|
||||
public PythonClientExperimentalCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.BearerToken,
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.build();
|
||||
|
||||
// this may set datatype right for additional properties
|
||||
instantiationTypes.put("map", "dict");
|
||||
|
||||
languageSpecificPrimitives.add("file_type");
|
||||
languageSpecificPrimitives.add("none_type");
|
||||
|
||||
|
@ -23,6 +23,7 @@ import io.swagger.v3.oas.models.media.Schema;
|
||||
import io.swagger.v3.oas.models.parameters.Parameter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -69,6 +70,33 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
public RClientCodegen() {
|
||||
super();
|
||||
|
||||
featureSet = getFeatureSet().modify()
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
|
||||
.securityFeatures(EnumSet.of(
|
||||
SecurityFeature.BasicAuth,
|
||||
SecurityFeature.ApiKey,
|
||||
SecurityFeature.OAuth2_Implicit
|
||||
))
|
||||
.excludeGlobalFeatures(
|
||||
GlobalFeature.XMLStructureDefinitions,
|
||||
GlobalFeature.Callbacks,
|
||||
GlobalFeature.LinkObjects,
|
||||
GlobalFeature.ParameterStyling
|
||||
)
|
||||
.excludeSchemaSupportFeatures(
|
||||
SchemaSupportFeature.Polymorphism
|
||||
)
|
||||
.excludeParameterFeatures(
|
||||
ParameterFeature.Cookie
|
||||
)
|
||||
.includeClientModificationFeatures(
|
||||
ClientModificationFeature.BasePath,
|
||||
ClientModificationFeature.UserAgent
|
||||
)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/r";
|
||||
modelTemplateFiles.put("model.mustache", ".R");
|
||||
apiTemplateFiles.put("api.mustache", ".R");
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user