From c2ee4aefe13448aa16701bdbc5edcb8129a4f22a Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Sun, 5 Jan 2020 09:23:04 -0500 Subject: [PATCH] Initial CODEOWNERS (#4924) --- .github/CODEOWNERS | 30 +++++++++ modules/openapi-generator/.gitignore | 3 - .../src/main/java/config/Config.java | 51 ---------------- .../src/main/java/config/ConfigParser.java | 61 ------------------- 4 files changed, 30 insertions(+), 115 deletions(-) create mode 100644 .github/CODEOWNERS delete mode 100644 modules/openapi-generator/.gitignore delete mode 100644 modules/openapi-generator/src/main/java/config/Config.java delete mode 100644 modules/openapi-generator/src/main/java/config/ConfigParser.java diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000000..26b750dff4f --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,30 @@ +## Core team +modules/openapi-generator/src/main/java/org/openapitools/codegen/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapitools/codegen/auth/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapitools/codegen/config/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/**/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapitools/codegen/serializer/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/**/*.java @OpenAPITools/generator-core-team +modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/**/*.java @OpenAPITools/generator-core-team +modules/openapi-generator-core/**/* @OpenAPITools/generator-core-team + +# No need for auto-generated subdirectories (reduces noise) +docs/ @OpenAPITools/generator-core-team + +## Individual interests +.github/**/* @jimschubert +scripts/**/* @jimschubert +website/**/* @jimschubert +bin/ci/**/* @jimschubert + +## Bulid related +CI/**/* @OpenAPITools/build +.mvn/**/* @OpenAPITools/build +bin/utils/**/* @OpenAPITools/build + +## Module-specific +modules/openapi-generator-cli/**/* @jimschubert +modules/openapi-generator-gradle-plugin/**/* @jimschubert +modules/openapi-generator-maven-plugin/**/* @jimschubert + diff --git a/modules/openapi-generator/.gitignore b/modules/openapi-generator/.gitignore deleted file mode 100644 index 3e9b4fcd792..00000000000 --- a/modules/openapi-generator/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/.settings/ -/test-output/ -/bin/ diff --git a/modules/openapi-generator/src/main/java/config/Config.java b/modules/openapi-generator/src/main/java/config/Config.java deleted file mode 100644 index c4b1718771d..00000000000 --- a/modules/openapi-generator/src/main/java/config/Config.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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 config; - -import com.google.common.collect.ImmutableMap; - -import java.util.HashMap; -import java.util.Map; - -public class Config { - private Map options; - - public Config() { - this.options = new HashMap(); - } - - public Config(Map properties) { - this.options = properties; - } - - public Map getOptions() { - return ImmutableMap.copyOf(options); - } - - public boolean hasOption(String opt) { - return options.containsKey(opt); - } - - public String getOption(String opt) { - return options.get(opt); - } - - public void setOption(String opt, String value) { - options.put(opt, value); - } -} diff --git a/modules/openapi-generator/src/main/java/config/ConfigParser.java b/modules/openapi-generator/src/main/java/config/ConfigParser.java deleted file mode 100644 index 3c3040faed9..00000000000 --- a/modules/openapi-generator/src/main/java/config/ConfigParser.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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 config; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.Iterator; -import java.util.Map; - -public class ConfigParser { - - private static final Logger LOGGER = LoggerFactory.getLogger(ConfigParser.class); - - public static Config read(String location) { - - LOGGER.info("reading config from " + location); - - ObjectMapper mapper = new ObjectMapper(); - - Config config = new Config(); - - try { - JsonNode rootNode = mapper.readTree(new File(location)); - Iterator> optionNodes = rootNode.fields(); - - while (optionNodes.hasNext()) { - Map.Entry optionNode = optionNodes.next(); - - if (optionNode.getValue().isValueNode()) { - config.setOption(optionNode.getKey(), optionNode.getValue().asText()); - } else { - LOGGER.warn("omitting non-value node " + optionNode.getKey()); - } - } - } catch (Exception e) { - LOGGER.error(e.getMessage()); - return null; - } - - return config; - } -}