Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[core] Initial FeatureSet structures #3614

Merged
merged 101 commits into from
Jan 11, 2020
Merged
Show file tree
Hide file tree
Changes from 96 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
c4ecb27
[core] Initial FeatureSet structures
jimschubert Aug 12, 2019
7f418da
Rename/clarify some Schema support
jimschubert Sep 13, 2019
b66a518
Additional feature metadata
jimschubert Sep 27, 2019
b8393ac
Remove non-standard javadoc tags in favor of p
jimschubert Sep 30, 2019
566b176
Improve API usability of FeatureSet
jimschubert Sep 30, 2019
b4e6383
Add default feature set to DefaultCodegen
jimschubert Sep 30, 2019
7700e6e
Merge branch 'master' into feature-sets-meta
jimschubert Sep 30, 2019
8958fb0
Update featureSet on Protobuf generator
jimschubert Sep 30, 2019
36b2bc4
Add README feature to generators which output README files
jimschubert Oct 10, 2019
bad1412
Update Kotlin client featureset
jimschubert Oct 11, 2019
9cdce66
Merge branch 'master' into feature-sets-meta
jimschubert Oct 14, 2019
6e10f41
[Samples] regenerate
jimschubert Oct 14, 2019
855d3c8
[ada] FeatureSet definitions
jimschubert Oct 16, 2019
29b2ece
[android] FeatureSet definitions
jimschubert Oct 16, 2019
c6d7b43
[apache2] FeatureSet definitions
jimschubert Oct 16, 2019
ee52c55
[asciidoc] FeatureSet definitions
jimschubert Oct 17, 2019
e690a55
Standardize plural include/exclude methods in FeatureSet
jimschubert Oct 17, 2019
8d67772
[aspnetcore] FeatureSet Definitions
jimschubert Oct 17, 2019
ba24c80
[avro] FeatureSet Definitions
jimschubert Oct 17, 2019
04a64f9
[bash] FeatureSet Definitions
jimschubert Oct 17, 2019
5f05a48
[c] FeatureSet Definitions
jimschubert Oct 17, 2019
ee0c9bc
[clojure] FeatureSet Definitions
jimschubert Oct 19, 2019
154a80f
[cwiki] FeatureSet Definitions
jimschubert Oct 19, 2019
96ee2c6
[cpp-pistache-server] FeatureSet Definitions
jimschubert Oct 19, 2019
2b6ccce
[cpp-qt5-client] FeatureSet Definitions
jimschubert Oct 19, 2019
6d54b54
[cpp-qt5-qhttpengine-server] FeatureSet Definitions
jimschubert Oct 19, 2019
d0ed439
[cpp-restbed-server] FeatureSet Definitions
jimschubert Oct 19, 2019
c9e5531
[cpp-restsdk] FeatureSet Definitions
jimschubert Oct 19, 2019
9d5785b
[cpp-tizen] FeatureSet Definitions
jimschubert Oct 19, 2019
feb5b15
[csharp] FeatureSet Definitions
jimschubert Oct 19, 2019
1b30879
[csharp-nancyfx] FeatureSet Definitions
jimschubert Oct 19, 2019
11682be
[csharp-netcore] FeatureSet Definitions
jimschubert Oct 19, 2019
360cf4a
[dart] FeatureSet Definitions
jimschubert Oct 19, 2019
7e3e51e
[eiffel] FeatureSet Definitions
jimschubert Oct 19, 2019
2f78a5a
[elixir] FeatureSet Definitions
jimschubert Oct 19, 2019
d41aca0
[elm] FeatureSet Definitions
jimschubert Oct 19, 2019
1792063
Fix missed cookie support
jimschubert Oct 19, 2019
5e5de0e
[erlang] FeatureSet Definitions
jimschubert Oct 19, 2019
db72e3f
[flash] FeatureSet Definitions
jimschubert Oct 19, 2019
b0375f2
Evaluating special characters in yaml files
jimschubert Oct 20, 2019
621b92b
[fsharp-functions] FeatureSet Definitions
jimschubert Oct 25, 2019
e5d8761
[go] Client/Server FeatureSet Definitions
jimschubert Oct 25, 2019
040c227
[graphql-nodejs-express-server] FeatureSet Definitions
jimschubert Oct 25, 2019
c9c7817
[graphql-schema] FeatureSet Definitions
jimschubert Oct 25, 2019
2d72d40
[groovy] FeatureSet Definitions
jimschubert Oct 25, 2019
0cd1c3b
[haskell-http-client] FeatureSet Definitions
jimschubert Oct 25, 2019
67ac84f
[java] FeatureSet Definitions
jimschubert Nov 3, 2019
e1bccd1
[typescript] FeatureSet Definitions
jimschubert Nov 3, 2019
99f3085
[haskell] FeatureSet Definitions
jimschubert Nov 3, 2019
494aa92
[jmeter] FeatureSet Definitions
jimschubert Nov 3, 2019
585e34c
[kotlin-server] FeatureSet Definitions
jimschubert Nov 3, 2019
485b4b3
[kotlin-spring] FeatureSet Definitions
jimschubert Nov 3, 2019
0a368fd
[kotlin][vertx] FeatureSet Definitions
jimschubert Nov 3, 2019
0b0f39b
[lua] FeatureSet Definitions
jimschubert Nov 3, 2019
0515a8a
[mysql] FeatureSet Definitions
jimschubert Nov 3, 2019
491210f
[nim] FeatureSet Definitions
jimschubert Nov 3, 2019
a7a67e2
[nodejs] FeatureSet Definitions
jimschubert Nov 3, 2019
315cf06
[nodejs-express] FeatureSet Definitions
jimschubert Nov 3, 2019
5314dc3
[swift] FeatureSet Definitions
jimschubert Nov 3, 2019
c96e8ad
[objc] FeatureSet Definitions
jimschubert Nov 3, 2019
51bfdb5
[openapi] FeatureSet Definitions
jimschubert Nov 3, 2019
45afb51
[static][docs] FeatureSet Definitions
jimschubert Nov 3, 2019
b889bbb
[scalatra] FeatureSet Definitions
jimschubert Nov 3, 2019
df540b3
[spring] FeatureSet Definitions
jimschubert Nov 3, 2019
eaf82b2
[scalaz] FeatureSet Definitions
jimschubert Nov 3, 2019
2443ad5
[scala-play] FeatureSet Definitions
jimschubert Nov 3, 2019
815a78a
[scala-lagom] FeatureSet Definitions
jimschubert Nov 3, 2019
5ed2a6e
[scala-gatling] FeatureSet Definitions
jimschubert Nov 3, 2019
c29f2eb
[scala-finch] FeatureSet Definitions
jimschubert Nov 3, 2019
e4edfd5
[ruby-sinatra] FeatureSet Definitions
jimschubert Nov 3, 2019
d49cde6
[ruby] FeatureSet Definitions
jimschubert Nov 3, 2019
406b7f6
[ocaml] FeatureSet Definitions
jimschubert Nov 3, 2019
a1c8b04
[perl] FeatureSet Definitions
jimschubert Nov 3, 2019
5b040a3
[scala-http-client] FeatureSet Definitions
jimschubert Nov 3, 2019
d6663bf
[scala-akka] FeatureSet Definitions
jimschubert Nov 3, 2019
fb6b92e
[ruby] FeatureSet Definitions
jimschubert Nov 3, 2019
60616e1
[rust] FeatureSet Definitions
jimschubert Nov 3, 2019
f97945b
[ror] FeatureSet Definitions
jimschubert Nov 3, 2019
7481aab
[r] FeatureSet Definitions
jimschubert Nov 3, 2019
663db39
[openapi-yaml] FeatureSet Definitions
jimschubert Nov 3, 2019
f5d2dce
[php] FeatureSet Definitions
jimschubert Nov 3, 2019
8f0d0c4
[python] FeatureSet Definitions
jimschubert Nov 3, 2019
775a916
[python-experimental] FeatureSet Definitions
jimschubert Nov 3, 2019
208174c
[python-blueplanet] FeatureSet Definitions
jimschubert Nov 3, 2019
8e94b3c
[python-aiohttp] FeatureSet Definitions
jimschubert Nov 3, 2019
f771304
[protobuf-schema] FeatureSet Definitions
jimschubert Nov 3, 2019
3087cfd
[powershell] FeatureSet Definitions
jimschubert Nov 3, 2019
ae403c8
[php-ze-ph] FeatureSet Definitions
jimschubert Nov 3, 2019
be67fa5
[php-symfony] FeatureSet Definitions
jimschubert Nov 3, 2019
139ba67
[php-laravel] FeatureSet Definitions
jimschubert Nov 3, 2019
6e4ac57
[php-lumen] FeatureSet Definitions
jimschubert Nov 3, 2019
08b3383
[php-silex] FeatureSet Definitions
jimschubert Nov 3, 2019
f8c2011
[php-slim] FeatureSet Definitions
jimschubert Nov 3, 2019
2a2c5c5
Merge branch 'master' of github.com:OpenAPITools/openapi-generator
jimschubert Nov 3, 2019
381fe91
Merge branch 'master' into feature-sets-meta
jimschubert Nov 3, 2019
6e4e159
[samples] Regenerate
jimschubert Nov 3, 2019
6e4317d
Merge branch 'master' into feature-sets-meta
jimschubert Nov 9, 2019
60d79b8
[samples] Regenerate elm.
jimschubert Nov 10, 2019
cafc61c
Merge branch 'master' into feature-sets-meta
jimschubert Jan 5, 2020
e35c683
[samples] Regenerate
jimschubert Jan 5, 2020
81c8662
[rust] update feature set based on contrib feedback
jimschubert Jan 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -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) {
stability = builder.stability;
generationMessage = builder.generationMessage;
if (builder != null) {
stability = builder.stability;
generationMessage = builder.generationMessage;
libraryFeatures = builder.libraryFeatures;
featureSet = builder.featureSet;
}
}

/**
Expand All @@ -37,18 +50,13 @@ public static Builder newBuilder() {
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;
}
Expand All @@ -71,12 +79,32 @@ public Stability getStability() {
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() {
}
Expand All @@ -92,6 +120,32 @@ public Builder stability(Stability stability) {
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.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
Loading