[
  {
    "path": ".gitignore",
    "content": "# Output Directory\ntarget/\n\n# C pre-compile\n*.gch\n*.pch\n\n# C compile\n*.a\n*.o\n*.ko\n*.la\n*.lo\n*.obj\n*.elf\n*.so\n*.so.*\n*.dylib\n*.exe\n*.lib\n*.dll\n*.out\n*.app\n*.hex\n\n# Debug files\n*.dSYM/\n\n# Java\n*.class\n\n# Java Package Files\n*.jar\n*.war\n*.ear\n\n# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml\nhs_err_pid*\n\n# Zip Files\n*.rar\n*.zip\n*.7z\n*.tar\n*.gz\n\n# Ant\nbuild/\n\n# Compiled Python\n__pycache__/\n*.py[cod]\n*py.class\n\n# Eclipse\n.settings/\n.classpath\n.project\n\n# IntelliJ, based on http://devnet.jetbrains.net/docs/DOC-1186\n.idea/\n*.iml\n*.ipr\n*.iws\n\n# logs and trace\n*.log\n*.trace\n*.dat\n\n# vi swap\n*.swp\n\n# Backup Files\n*.bak\n*.old\n\n# SVN metadata\n.svn/\n\n# Mac\n.DS_Store\n\n# gradle\n.gradle\n\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n================================================================\nFor codegen/src/main/resources/ServiceComb/*\nFor cli/src/test/resources/swagger.yaml\nFor codegen/src/test/resources/swagger.yaml\n================================================================\nThis product bundles files from swagger-codegen which is licensed under the Apache License v2.\nFor details, see https://github.com/swagger-api/swagger-codegen\n\n================================================================\nFor codegen/src/main/resources/examples/*\n================================================================\nThis product bundles files from swagger-codegen which is licensed under the Apache License v2.\nFor details, see https://github.com/OAI/OpenAPI-Specification"
  },
  {
    "path": "NOTICE",
    "content": "Apache ServiceComb Toolkit\nCopyright 2019-present The Apache Software Foundation\n\nThis product includes software developed at\nThe Apache Software Foundation (http://www.apache.org/).\n"
  },
  {
    "path": "README-ZH.md",
    "content": "# Toolkit | [English](./README.md) [![Build Status](https://travis-ci.org/apache/servicecomb-toolkit.svg?branch=master)](https://travis-ci.org/apache/servicecomb-toolkit?branch=master)[![Coverage Status](https://coveralls.io/repos/github/apache/servicecomb-toolkit/badge.svg?branch=master)](https://coveralls.io/github/apache/servicecomb-toolkit?branch=master)[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=servicecomb-toolkit&metric=alert_status)](https://sonarcloud.io/dashboard?id=servicecomb-toolkit) [![Gitter](https://img.shields.io/badge/ServiceComb-Gitter-ff69b4.svg)](https://gitter.im/ServiceCombUsers/Lobby)\n\nApache ServiceComb Toolkit 是基于契约的微服务开发工具套件\n\n> 贡献者: 这个项目缺少维护者，如果您愿意为项目维护提供支持，请联系我们，可以将您加入项目的commiter群组，继续维护该项目. \n\n> 用户：这个项目缺少维护者，在我们找到持续的维护者之前，建议您尽可能不要使用这个项目，避免碰到问题得不到技术支持. \n\n## 1 简介\n\n### 1.1 目标\n\n* 提供契约、代码、文档相互转换及校验的能力，帮助用户一键式快速构建基于流行微服务框架和流行编程模型的微服务工程，降低微服务入门成本，使用户聚焦业务开发，提升遗留系统重构、开发效率。\n\n![image](./images/scene-zh.png)\n\n### 1.2 特性\n\n* 遗留应用提取契约文件\n\n  在基于SpringMVC/POJO/JAX-RS模型开发的应用中，一键提取符合OpenAPI规范的服务契约文件。\n\n* 契约文件生成微服务工程\n\n  输入符合OpenAPI规范的服务契约，一键生成以ServiceComb/SpringCloud/Swagger为底座，以及以SpringMVC/POJO/JAX-RS或SpringBoot为开发模型的微服务项目。\n\n* 契约与代码一致性校验\n\n  校验应用的实际实现（如数据和服务API）是否与样本服务契约描述一致。\n\n* 契约的风格校验和兼容性校验\n\n  风格校验检查契约是否符合[OAS 3.0.2规范][openapi-3.0.2]以及自定义的规则; 兼容性校验检查新旧两个版本的OAS的兼容性 \n  \n* 契约/代码生成文档\n\n  输入符合OpenAPI规范的服务契约，一键生成html格式的文档。\n\n* Todo List\n\n  * 支持gradle plugin, eclipse plugin, intellij plugin。\n\n  * 支持word、pdf等流行格式文档。\n\n  * 支持契约增量生成代码。\n\n  * 工具能力服务化。\n    \n  * Server端自动/半自动测试\n    \n  * Interface匹配性校验\n  \n  * 支持生成包含连接Mysql/Redis等常见DB的代码片段的微服务脚手架\n\n### 1.3 适用场景\n\n* 集成多厂商应用的企业\n\n  问题：厂商数据、服务标准不一致，开发语言、习惯、框架不一致，集成商难集成，企业难管控。\n\n  措施：通过统一定义的接口描述标准（服务契约），使用工具套件一键生成基于指定微服务框架的微服务工程，并且通过服务契约校验手段协同维护整体系统的一致性。以此协调多个开发团队，降低沟通成本且避免后期的混乱。\n\n* 遗留系统微服务化快速改造\n\n  问题：用户需要额外学习和理解微服务及相关框架后，再设计微服务工程，学习成本高。\n\n  措施：使用工具套件分析遗留应用提取服务契约，再一键生成基于指定微服务框架的微服务工程后，即可聚焦业务开发，减少用户对微服务框架的学习成本。\n\n## 2 设计\n\n### 2.1 主体架构\n\n![image](./images/architecture-zh.png)\n\n### 2.2 工作原理\n\n![image](./images/workingprinciple-zh.png)\n\n## 3 快速入门\n### 3.1 从源码构建工具和插件\n构建环境要求:\n\n* [Java 8](http://java.oracle.com)\n\n* [Apache maven 3.5.0 or greater](http://maven.apache.org/)\n\n```shell\n# 从github获取toolkit最新源码\n$ git clone https://github.com/apache/servicecomb-toolkit.git\n$ cd toolkit\n\n# 构建打包\n$ mvn clean install\n```\n\n\n### 3.2 使用toolkit-maven-plugin插件\n#### 3.2.1 配置\n在maven项目的pom文件中配置\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- 输入源。设置为 code，表示解析当前代码；设置为 contract，表示解析指定目录的契约文件。不设置则默认为 code -->\n        <sourceType>code</sourceType>\n        <!-- 生成契约文件的类型，不设置则默认为 yaml -->\n        <contractFileType>yaml</contractFileType>\n        <!-- 生成文档的类型，不设置则默认为 html -->\n        <documentType>html</documentType>\n        <!-- 生成契约文件、文档的根目录，不设置则默认为运行命令所在目录下的 target 目录，生成的微服务工程在 project 目录，契约文件在 contract 目录，文档在 document 目录 -->\n        <outputDirectory>./target</outputDirectory>\n        <!-- 被解析的契约文件路径，在 sourceType 设置为 contract 时有效，且必须设置 -->\n        <contractLocation>./contract</contractLocation>\n        <!-- 被校验的契约文件目录，在 sourceType 设置为 contract 时有效，且必须设置 -->\n        <sourceContractPath>./target/contract</sourceContractPath>\n        <!-- 样本契约文件目录，必须设置 -->\n        <destinationContractPath>./contract</destinationContractPath>\n        <!-- 生成的微服务代码工程配置 -->\n        <service>\n            <!-- 微服务的类型，可生成 provider/consumer/all，默认值为 all -->\n            <serviceType>all</serviceType>\n            <!-- 微服务的 groupid，用户可选，默认值为 domain.orgnization.project -->\n            <groupId>domain.orgnization.project</groupId>\n            <!-- 微服务的 artifactId，用户可选，默认值为 sample -->\n            <artifactId>sample</artifactId>\n            <!-- 微服务的 artifactVersion，用户可选，默认值为 0.1.0-SNAPSHOT -->\n            <artifactVersion>0.1.0-SNAPSHOT</artifactVersion>\n            <!-- 微服务的 packageName，用户可选，默认值为 domain.orgnization.project.sample -->\n            <packageName>domain.orgnization.project.sample</packageName>\n            <!-- 微服务框架，用户可选。设置为 ServiceComb，生成ServiceComb风格的微服务项目；设置为 SpringCloud，生成SpringCloud风格的微服务项目。默认值为 ServiceComb -->\n            <microServiceFramework>ServiceComb</microServiceFramework>\n            <!-- 服务提供者的服务id。仅包含服务消费者的场景（serviceType=consumer）必须设置该值 -->            \n            <providerServiceId>servicecomb-provider</providerServiceId>\n            <!-- 服务id，默认值为artifactId的值 -->\n            <serviceId>servicecomb-consumer</serviceId>\n        </service>\n        <!-- 指定额外的属性值，这些属性值可以被mustach模板引用。仅为生成代码时使用，即goal为generate -->\n        <additionalProperties>\n            <prop1>value</prop1>\n            <prop2>value</prop2>\n            ...\n            <propN>value</propN>\n        </additionalProperties>\n    </configuration>\n</plugin>\n```\n\n#### 3.2.2 命令\n```shell\n# 生成契约，文档和微服务工程\nmvn toolkit:generate\n\n# 校验代码和契约一致性\nmvn toolkit:verify\n```\n\n#### 3.2.2.1 解析代码，生成微服务代码工程、OpenAPI规范契约、文档\n\n配置项(不显式设置 `<configuration>` 则使用默认配置)\n例：\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- 输入源。设置为 code，表示解析当前代码；设置为 contract，表示解析指定目录的契约文件。不设置则默认为 code -->\n        <sourceType>code</sourceType>\n        <!-- 生成契约文件、文档的根目录，不设置则默认为运行命令所在目录下的 target 目录，生成的微服务工程在 project 目录，契约文件在 contract 目录，文档在 document 目录 -->\n        <outputDirectory>./target</outputDirectory>\n        <!-- 生成的微服务代码工程配置 -->\n        <service>\n            <!-- 微服务的类型，可生成 provider/consumer/all，默认值为 all -->\n            <serviceType>all</serviceType>\n        </service>\n    </configuration>\n</plugin>\n```\n\n运行命令\n```shell\nmvn toolkit:generate\n```\n\n代码生成契约现已支持以下注解(类级别)编写的restful接口\n>RestController, RestSchema, RpcSchema, RequestMapping\n\n代码生成契约时,restful接口方法修饰符必须指定为public\n\n\n#### 3.2.2.2 解析契约，生成微服务工程、文档\n\n配置项(不显式设置 `<configuration>` 则使用默认配置)\n例：\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- 输入源。设置为 code，表示解析当前代码；设置为 contract，表示解析指定目录的契约文件。不设置则默认为 code -->\n        <sourceType>contract</sourceType>\n        <!-- 被解析的契约文件路径，在 sourceType 设置为 contract 时有效，且必须设置 -->\n        <contractLocation>./contract</contractLocation>\n        <!-- 生成契约文件、文档的根目录，不设置则默认为运行命令所在目录下的 target 目录，生成的微服务工程在 project 目录，契约文件在 contract 目录，文档在 document 目录 -->\n        <outputDirectory>./target</outputDirectory>\n        <!-- 生成的微服务代码工程配置 -->\n        <service>\n            <!-- 微服务的类型，可生成 provider/consumer/all，默认值为 all -->\n            <serviceType>provider</serviceType>\n        </service>\n    </configuration>\n</plugin>\n```\n\n运行命令\n```shell\nmvn toolkit:generate\n```\n\n#### 3.2.2.3 代码和契约一致性校验\n\n配置项\n例：\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- 输入源。设置为 code，表示解析当前代码；设置为 contract，表示解析指定目录的契约文件。不设置则默认为 code -->\n        <sourceType>code</sourceType>\n        <!-- 样本契约文件目录，必须设置 -->\n        <destinationContractPath>./contract</destinationContractPath>\n    </configuration>\n</plugin>\n```\n\n运行命令\n```shell\nmvn toolkit:verify\n```\n\n\n### 3.3 使用toolkit cli工具\n\n#### 3.3.0 获取\n* 如果你使用的是正式发布版本（>=0.2.0）,可以在解压二进制包后直接使用里面的脚本文件\n  * 在Linux及Mac环境，请使用cli.sh  \n  * 在Windows环境，请使用cli.cmd\n  \n* 如果你是通过源码构建，可以将`cli/scripts/cli.*`与`cli/target/bin/toolkit-cli-{version}.jar`放置在同一目录，然后根据不同环境选择不同脚本\n\n以下所有示例均通过Linux环境的cli.sh进行介绍\n```shell\n$ ./cli.sh help\n```\n#### 3.3.1 契约生成微服务工程\n```shell\n$ ./cli.sh  codegenerate -m ServiceComb -i swagger.yaml -o ./project -p SpringMVC\n```\n> **codegenerate** 命令选项说明:\n* -m, --microservice-framework : 指定微服务框架,现支持ServiceComb  \n例：-m ServiceComb\n* -p, --programming-model : 指定编程模型，可选JAX-RS，POJO，SpringMVC，SpringBoot  \n例：-p SpringMvc\n* -i, --input : 指定遵循OpenAPI规范的契约文件，支持yaml和json格式，支持指定本地和网络文件  \n例：-i http://petstore.swagger.io/v2/swagger.json\n* -o, --output : 生成的项目代码输出路径  \n例：-o ./project\n* --group-id : 指定生成的项目的group id  \n例：--group-id com.demo\n* --artifact-id : 指定生成的项目的artifact id     \n例：--artifact-id springmvc-example\n* --artifact-version : 指定生成的项目的artifact version  \n例：--artifact-version 1.0.0\n* --api-package : 指定生成项目的api package  \n例：--api-package com.demo.api\n* --model-package : 指定生成项目的model package   \n例：--model-package com.demo.model\n* -t, --service-type : 指定生成的微服务项目的微服务类型。可选值为provider,consumer,all                  \n例：--service-type provider\n* --properties : 指定额外的属性值，这些属性值可以被mustach模板引用\n例：--properties applicationId=app,providerServiceId=provider  \n\n#### 3.3.2 契约生成文档\n```shell\n$ ./cli.sh docgenerate -i swagger.yaml -o ./document\n```\n> **docgenerate** 命令选项说明:\n* -i, --input : 指定遵循OpenAPI规范的契约文件，支持yaml和json格式，支持指定本地和网络文件  \n例：-i http://petstore.swagger.io/v2/swagger.json\n* -o, --output : 文档输出路径   \n例：-o ./document\n* -f, --format : 指定输出文档风格,现支持swagger-ui\n例：-f swagger-ui\n\n#### 3.3.3 契约风格检查\n\n```shell\n$ ./cli.sh checkstyle -r style-check-rules.yaml -f oas.yaml\nor\n$ ./cli.sh cs -r style-check-rules.yaml -f oas.yaml\n```\n\n> **checkstyle** Command argument\n* -r, --rules-file. Rules properties file.\n* -f, --file. OpenAPI v3 spec yaml.\n\n见[风格检查规则](oas-validator/README-ZH.md)\n\n#### 3.3.4 契约兼容性检查\n\n```shell\n$ ./cli.sh checkcompatibility left-oas.yaml right-oas.yaml\n或者\n$ ./cli.sh cc left-oas.yaml right-oas.yaml\n```\n\n> **checkcompatibility** Command argument\n* &lt;files&gt; Two OpenAPI v3 spec yaml file\n\n见[兼容性检查规则](oas-validator/README-ZH.md)\n\n\n### 3.4 使用案例\n可以在[这里](./samples/README-ZH.md)找到使用插件的一些示例 \n\n## 4 社区互动\n\n* [提交issues](https://issues.apache.org/jira/browse/SCB)\n* [gitter聊天室](https://gitter.im/ServiceCombUsers/Lobby)\n* 邮件列表: [订阅](mailto:dev-subscribe@servicecomb.apache.org) [浏览](https://lists.apache.org/list.html?dev@servicecomb.apache.org)\n\n## 5 参与开发\n\nSee [Pull Request Guide](http://servicecomb.apache.org/developers/submit-codes/) for details.\n"
  },
  {
    "path": "README.md",
    "content": "# Toolkit | [中文](./README-ZH.md) [![Build Status](https://travis-ci.org/apache/servicecomb-toolkit.svg?branch=master)](https://travis-ci.org/apache/servicecomb-toolkit?branch=master)[![Coverage Status](https://coveralls.io/repos/github/apache/servicecomb-toolkit/badge.svg?branch=master)](https://coveralls.io/github/apache/servicecomb-toolkit?branch=master)[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=servicecomb-toolkit&metric=alert_status)](https://sonarcloud.io/dashboard?id=servicecomb-toolkit) [![Gitter](https://img.shields.io/badge/ServiceComb-Gitter-ff69b4.svg)](https://gitter.im/ServiceCombUsers/Lobby)\n\nApache ServiceComb Toolkit is a contract-based microservice development toolkit\n\n> Notice to contributors: this project is not active due to lack of maintainers. If you are interested in this project, please cantact us and we will help you to be a committer. \n\n> Notice to users: this project is not active due to lack of maintainers. Before we find enough resources, do not use this project if possible. \n\n## 1 Introduction\n\n### 1.1 Conceptions\n\n* Provides the ability to convert and verify contracts, code, and documents, helping users quickly build microservice projects based on popular microservices frameworks and popular programming models, reducing the cost of microservices entry, enabling users to focus on business development, enhance refactoring and development efficiency.\n\n![image](./images/scene-en.png)\n\n### 1.2 Features\n\n* Code extraction service contract\n\n  In applications developed based on the SpringMVC/POJO/JAX-RS model, one-click generation of service contract files conforming to the OpenAPI specification.\n\n* Service contract generation microservice project\n\n  Enter a service contract that conforms to the OpenAPI specification, one-click generation of a microservice project with ServiceComb/SpringCloud/Swagger as the base microservice framework and SpringMVC/POJO/JAX-RS or SpringBoot as programming model.\n\n* Service contract and code consistency check\n\n  Verify that the actual implementation of the application (such as the data and service API) is consistent with the agreed service contract description.\n\n* Service contract style checking and compatibility checking\n\n  The style checking checks whether the contract conforms to [OAS 3.0.2 specification] [openapi-3.0.2] and custom rules; the compatibility checking checks whether new OAS spec compatible with old spec\n\n* Service contract/code generation document\n\n  Enter a service contract that conforms to the OpenAPI specification, one-click generation of a document in html format.\n\n* Todo List\n  \n  * Support gradle plugin, eclipse plugin, intellij plugin.\n\n  * Support for generating popular format documents such as word, pdf.\n\n  * Support contract incremental generation code.\n\n  * Make capability as a service.\n  \n  * Server-side automatic / semi-automatic test\n  \n  * Interface matching check\n  \n  * Support for generating microservice scaffolding containing code snippets that connect to common DBs such as Mysql / Redis\n\n### 1.3 Applicable Scene\n\n* For users who integrate multi-vendor applications\n\n  Scene: the development languages, habits, and frameworks of different vendors are different, the entire system data and service standards are inconsistent, users are difficult to integrate, and it is difficult to manage and control the final delivery quality.\n\n  Solution：Through a uniformly defined interface description standard (service contract), a toolkit is used to generate a microservice project based on a specified microservices framework, and the consistency of the whole system is coordinated through service contract verification. Coordinate multiple development teams to reduce communication costs and avoid post-chaos.\n\n* For users who have evolved from legacy systems to microservices\n\n  Scene: additional learning and understanding of the microservices-related framework details is required before the microservices project can be designed, built, and developed according to the selected microservices framework. For users, Need to be distracted to focus on things outside the business.\n\n  Solution: Using the toolkit to analyze the legacy application extraction service contract, and then generate the microservices project based on the specified microservices framework, you can focus on business development and reduce the learning cost of the microservices framework.\n\n## 2 Design\n\n### 2.1 Architecture\n\n![image](./images/architecture-en.png)\n\n### 2.2 Working Principle\n\n![image](./images/workingprinciple-en.png)\n\n## 3 Quick Start\n### 3.1 Build tool and plugins from source\n\n> Build environment requirements\n* [Java 8](http://java.oracle.com)\n* [Apache maven 3.5.0 or greater](http://maven.apache.org/)\n\n```shell\n# Get the latest source code for toolkit from github\n$ git clone https://github.com/apache/servicecomb-toolkit.git\n$ cd toolkit\n\n# Build package\n$ mvn clean install\n```\n\n### 3.2 Use the toolkit-maven-plugin plugin\n#### 3.2.1 configuration\nConfigured in the pom file of the maven project\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- Set to 'code' to resolve the current project. Set to 'contract' to resolve the contract file for the specified path.If not set, the default is 'code' -->\n        <sourceType>code</sourceType>\n        <!-- The type of the contract file is generated. If it is not set, the default is 'yaml' -->\n        <contractFileType>yaml</contractFileType>\n        <!-- The type of the generated document. If not set, the default is 'html' -->\n        <documentType>html</documentType>\n        <!-- The root directory to save microservice project,contract file and document. If it is not set, the default is the 'target' under the directory where the command is run -->\n        <outputDirectory>./target</outputDirectory>\n        <!-- Input contract file path. Valid when sourceType is set to 'contract', must be set -->\n        <contractLocation>./contract</contractLocation>\n        <!-- Checked contract file path. Valid when sourceType is set to 'contract', must be set -->\n        <sourceContractPath>./target/contract</sourceContractPath>\n        <!-- Sample contract file path, must be set -->\n        <destinationContractPath>./contract</destinationContractPath>\n        <!-- Generated microservice project configuration -->\n        <service>\n            <!-- Microservice type,can generated 'provider/consumer/all',the default is 'all' -->\n            <serviceType>all</serviceType>\n            <!-- Microservice project 'groupid',optional,the default is 'domain.orgnization.project' -->\n            <groupId>domain.orgnization.project</groupId>\n            <!-- Microservice project 'artifactId',optional,the default is 'sample' -->\n            <artifactId>sample</artifactId>\n            <!-- Microservice project 'artifactVersion',optional,the default is '0.1.0-SNAPSHOT' -->\n            <artifactVersion>0.1.0-SNAPSHOT</artifactVersion>\n            <!-- Microservice project 'packageName',optional,the default is 'domain.orgnization.project.sample' -->\n            <packageName>domain.orgnization.project.sample</packageName>\n        </service>\n        <!-- Specify additional attribute values that can be referenced by the mustache template.Only used when plugin goal is generate -->\n        <additionalProperties>\n            <prop1>value</prop1>\n            <prop2>value</prop2>\n            ...\n            <propN>value</propN>\n        </additionalProperties>\n    </configuration>\n</plugin>\n```\n\n#### 3.2.2 Command\n```shell\n# Generating contract, document and microservice project\nmvn toolkit:generate\n\n# Verify code and contract consistency\nmvn toolkit:verify\n```\n\n#### 3.2.2.1 Extract the microservice project, OpenAPI contract file and document from the code\n\nConfiguration(use default configuration if not set `<configuration>`)\n\nexample\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- Set to 'code' to resolve the current project. Set to 'contract' to resolve the contract file for the specified path.If not set, the default is 'code' -->\n        <sourceType>code</sourceType>\n        <!-- The root directory to save contract file and document. If it is not set, the default is the 'target' under the directory where the command is run -->\n        <outputDirectory>./target</outputDirectory>\n        <!-- Generated microservice project configuration -->\n        <service>\n            <!-- Microservice type,can generated 'provider/consumer/all',the default is 'all' -->\n            <serviceType>all</serviceType>\n        </service>\n    </configuration>\n</plugin>\n```\n\nRun in shell\n```shell\nmvn toolkit:generate\n```\n\nWhen generating contracts from code,support for identifying restful interfaces written by the following annotations (class level)\n>RestController, RestSchema, RpcSchema, RequestMapping\n\nWhen generating contracts from code,the restful interface method access modifier must be specified as public\n\n\n#### 3.2.2.2 Generate the microservice project and document from contract\n\nConfiguration(use default configuration if not set `<configuration>`)\n\nexample\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- Set to 'code' to resolve the current project. Set to 'contract' to resolve the contract file for the specified path.If not set, the default is 'code' -->\n        <sourceType>contract</sourceType>\n        <!-- The root directory to save contract file and document. If it is not set, the default is the 'target' under the directory where the command is run -->\n        <outputDirectory>./target</outputDirectory>\n        <!-- Input contract file path. Valid when sourceType is set to 'contract', must be set -->\n        <contractLocation>./contract</contractLocation>\n        <!-- Generated microservice project configuration -->\n        <service>\n            <!-- Microservice type,can generated 'provider/consumer/all',the default is 'all' -->\n            <serviceType>provider</serviceType>\n        </service>\n    </configuration>\n</plugin>\n```\n\nRun in shell\n```shell\nmvn toolkit:generate\n```\n\n#### 3.2.2.3 Contract verify\n\nConfiguration\n\nexample\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- Set to 'code' to resolve the current project. Set to 'contract' to resolve the contract file for the specified path.If not set, the default is 'code' -->\n        <sourceType>code</sourceType>\n        <!-- Sample contract file path, must be set -->\n        <destinationContractPath>./contract</destinationContractPath>\n    </configuration>\n</plugin>\n```\n\nRun in shell\n```shell\nmvn toolkit:verify\n```\n\n\n### 3.3 Use the toolkit cli\n* If you are using the official release version ( >=0.2.0 ), you can use the script files directly after decompressing the binary package\n  * In Linux and Mac environment, please use cli.sh\n  * In the Windows environment, please use cli.cmd\n* If you are building from source, you can put `cli/scripts/cli.*` in the same directory as`cli/target/bin/toolkit-cli-{version}.jar` and then choose different scripts according to different environments\n\nAll the examples below are introduced through cli.sh for Linux environment\n```shell\n$ ./cli.sh help\n```\n#### 3.3.1 Service contract generation microservice project\n```shell\n$ ./cli.sh codegenerate -m ServiceComb -i swagger.yaml -o ./project -p SpringMVC\n```\n> **codegenerate** Command option\n* -m, --microservice-framework. Specify microservices framework, now supports ServiceComb.  \ne.g.：-m ServiceComb\n* -p, --programming-model. Specify programming model, optional JAX-RS, POJO, SpringMVC, SpringBoot.  \ne.g.：-p SpringMvc\n* -i, --input. Specifies contract files that follow the OpenAPI specification, supports yaml and json formats, and supports specifying local and network files.  \ne.g.：-i http://petstore.swagger.io/v2/swagger.json\n* -o, --output. Generated project code output path.  \ne.g.：-o ./project\n* --group-id. Specify the group id of the generated project.  \ne.g.：--group-id com.demo\n* --artifact-id. Specify the artifact id of the generated project.  \ne.g.：--artifact-id springmvc-example\n* --artifact-version. Specify the artifact version of the generated project.   \ne.g.：--artifact-version 1.0.0\n* --api-package : Specify the api package of the generated project.   \ne.g.：--api-package com.demo.api  \n* --model-package : Specify the model package of the generated project.  \ne.g.：--model-package com.demo.model\n* -t, --service-type : Specify microservice type of generated microservice project. optional value is provider,consumer,all               \ne.g.：--service-type provider  \n* --properties : Specify additional attribute values that can be referenced by the mustache template\ne.g.：--properties applicationId=app,providerServiceId=provider \n\n#### 3.3.2 Service contract generation document\n```shell\n$ ./cli.sh docgenerate -i swagger.yaml -o ./document\n```\n> **docgenerate** Command option\n* -i, --input. Specifies contract files that follow the OpenAPI specification, supports yaml and json formats, and supports specifying local and network files.\ne.g：-i http://petstore.swagger.io/v2/swagger.json\n* -o, --output. Document output path.\ne.g：-o ./document\n* -f, --format. Specifies the output document format, now supports swagger-ui\ne.g：-f swagger-ui\n\n#### 3.3.3 Service contract style checking\n\n```shell\n$ ./cli.sh checkstyle -r style-check-rules.yaml -f oas.yaml\nor\n$ ./cli.sh cs -r style-check-rules.yaml -f oas.yaml\n```\n\n> **checkstyle** Command argument\n* -r, --rules-file. Rules properties file.\n* -f, --file. OpenAPI v3 spec yaml.\n\nSee [style check rules](oas-validator/README.md)\n\n#### 3.3.4 Service contract compatibility checking\n\n```shell\n$ ./cli.sh checkcompatibility left-oas.yaml right-oas.yaml\nor\n$ ./cli.sh cc left-oas.yaml right-oas.yaml\n```\n\n> **checkcompatibility** Command argument\n* &lt;files&gt; Two OpenAPI v3 spec yaml file\n\nSee [compatibilty check rules](oas-validator/README.md)\n\n\n### 3.4 Use case\n\nsome example of using plugin can be found [here](./samples)\n\n## 4 Contact us\n\n* [issues](https://issues.apache.org/jira/browse/SCB)\n* [gitter](https://gitter.im/ServiceCombUsers/Lobby)\n* mailing list: [subscribe](mailto:dev-subscribe@servicecomb.apache.org) [view](https://lists.apache.org/list.html?dev@servicecomb.apache.org)\n\n## 5 Contribute\n\nPR: [Pull request](https://github.com/apache/servicecomb-toolkit/pulls)\n"
  },
  {
    "path": "cli/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>toolkit</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n    <relativePath>../</relativePath>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>cli</artifactId>\n\n  <properties>\n    <main.class>org.apache.servicecomb.toolkit.cli.ToolkitMain</main.class>\n\n  </properties>\n\n  <dependencies>\n    <dependency>\n      <groupId>io.airlift</groupId>\n      <artifactId>airline</artifactId>\n      <exclusions>\n        <exclusion>\n          <groupId>com.google.code.findbugs</groupId>\n          <artifactId>annotations</artifactId>\n        </exclusion>\n      </exclusions>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>codegen</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>junit</groupId>\n      <artifactId>junit</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>docgen</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-slf4j-impl</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-api</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-core</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-style</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-compatibility</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>com.github.stefanbirkner</groupId>\n      <artifactId>system-rules</artifactId>\n      <scope>test</scope>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-resources-plugin</artifactId>\n      </plugin>\n\n      <plugin>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-maven-plugin</artifactId>\n        <configuration>\n          <fork>true</fork>\n          <mainClass>${main.class}</mainClass>\n          <outputDirectory>target/bin</outputDirectory>\n          <finalName>toolkit-cli-${project.version}</finalName>\n        </configuration>\n        <executions>\n          <execution>\n            <goals>\n              <goal>repackage</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n\n    <resources>\n      <resource>\n        <directory>src/main/resources</directory>\n        <filtering>true</filtering>\n      </resource>\n    </resources>\n  </build>\n</project>\n"
  },
  {
    "path": "cli/scripts/cli.cmd",
    "content": "@REM Licensed to the Apache Software Foundation (ASF) under one or more\r\n@REM contributor license agreements.  See the NOTICE file distributed with\r\n@REM this work for additional information regarding copyright ownership.\r\n@REM The ASF licenses this file to You under the Apache License, Version 2.0\r\n@REM (the \"License\"); you may not use this file except in compliance with\r\n@REM the License.  You may obtain a copy of the License at\r\n@REM\r\n@REM     http://www.apache.org/licenses/LICENSE-2.0\r\n@REM\r\n@REM Unless required by applicable law or agreed to in writing, software\r\n@REM distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@REM See the License for the specific language governing permissions and\r\n@REM limitations under the License.\r\n\r\n@echo off && rem\r\n\r\nset SUCCESS_CODE=0\r\nset ERROR_CODE=1\r\n\r\n@REM check if java install\r\nif \"%JAVA_HOME%\" == \"\" goto JAVA_HOME_ERROR\r\nif not exist \"%JAVA_HOME%\\bin\\java.exe\" goto JAVA_HOME_ERROR\r\n\r\nset jarFile=\r\nfor /f \"delims=\" %%t in ('dir /S /B cli-*.jar') do set jarFile=%%t\r\n\r\n@REM check if jar file exist\r\nif \"%jarFile%\" == \"\" (\r\n  echo Error: cli.jar not exist. make sure it is placed in the current directory or subdirectory of this script\r\n  exit /B %ERROR_CODE% \r\n)\r\n\r\nset allparam=\r\n:param\r\nset str=%1\r\nif \"%str%\"==\"\" (\r\n    goto end\r\n)\r\nset allparam=%allparam% %str%\r\nshift /0\r\ngoto param\r\n\r\n:end\r\nif \"%allparam%\"==\"\" (\r\n    goto eof\r\n)\r\n\r\nrem remove left right blank\r\n:intercept_left\r\nif \"%allparam:~0,1%\"==\" \" set \"allparam=%allparam:~1%\"&goto intercept_left\r\n\r\n:intercept_right\r\nif \"%allparam:~-1%\"==\" \" set \"allparam=%allparam:~0,-1%\"&goto intercept_right\r\n\r\n:eof\r\n\r\njava -Dscript.name=\"cli.cmd\" -jar %jarFile% %allparam%\r\nexit /B %SUCCESS_CODE%\r\n\r\n:JAVA_HOME_ERROR\r\necho.\r\necho Error: JAVA_HOME invalid in your environment. >&2\r\necho Please set the JAVA_HOME variable in your environment to match the >&2\r\necho location of your Java installation. >&2\r\necho.\r\nexit /B %ERROR_CODE% \r\n"
  },
  {
    "path": "cli/scripts/cli.sh",
    "content": "#!/bin/bash\n## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n# check if java install\nif [ -z \"$JAVA_HOME\" -o ! -f \"$JAVA_HOME/bin/java\" ]; then\n  echo Error: JAVA_HOME invalid in your environment. >&2\n  echo Please set the JAVA_HOME variable in your environment to match the >&2\n  echo location of your Java installation. >&2\n  exit 1\nfi\n\n# resolve links - $0 may be a softlink\nPRG=\"$0\"\n\nwhile [ -h \"$PRG\" ] ; do\n  ls=`ls -ld \"$PRG\"`\n  link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n  if expr \"$link\" : '/.*' > /dev/null; then\n    PRG=\"$link\"\n  else\n    PRG=`dirname \"$PRG\"`/\"$link\"\n  fi\ndone\n\nshellDir=`dirname \"$PRG\"`\n\n# check if jar file exist\njarFile=$(find ${shellDir} -name \"cli-*.jar\" | head -n 1)\n\nif [[ ! -f ${jarFile} ]]; then\n echo \"error: cli.jar not exist. make sure it is placed in the current directory or subdirectory of this script\"\n exit 1\nfi\n\njava -Dscript.name=\"cli.sh\" -jar ${jarFile} $*\n"
  },
  {
    "path": "cli/src/main/java/org/apache/servicecomb/toolkit/cli/CheckCompatibility.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.cli;\n\nimport io.airlift.airline.Command;\n\n@Command(name = \"checkcompatibility\",\n    description = \"(Or cc for abbr). Check compatibility for two OpenAPI v3 spec yamls, right one should be semantically compatible with left one\")\npublic class CheckCompatibility extends CheckCompatibilityBase {\n\n}\n"
  },
  {
    "path": "cli/src/main/java/org/apache/servicecomb/toolkit/cli/CheckCompatibilityAbbr.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.cli;\n\nimport io.airlift.airline.Command;\n\n@Command(name = \"cc\",\n    description = \"Check compatibility for two OpenAPI v3 spec yamls,\"\n        + \" right one should be semantically compatible with left one\",\n    hidden = true)\npublic class CheckCompatibilityAbbr extends CheckCompatibilityBase {\n\n}\n"
  },
  {
    "path": "cli/src/main/java/org/apache/servicecomb/toolkit/cli/CheckCompatibilityBase.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.cli;\n\nimport java.io.IOException;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.List;\nimport java.util.StringJoiner;\n\nimport org.apache.commons.collections4.CollectionUtils;\nimport org.apache.commons.io.FileUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.CompatibilityCheckParser;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.factory.DefaultOasSpecDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasSpecDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.OasSpecDiffValidatorFactory;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.context.annotation.AnnotationConfigApplicationContext;\n\nimport io.airlift.airline.Arguments;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\n\npublic class CheckCompatibilityBase implements Runnable {\n\n  private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());\n\n  @Arguments(\n      title = \"files\", required = true,\n      description = \"Two OpenAPI v3 spec yamls\"\n  )\n  private List<String> filePaths;\n\n  @Override\n  public void run() {\n\n    if (filePaths.size() != 2) {\n      LOGGER.error(\"Require 2 files\");\n      return;\n    }\n\n    OpenAPI oldOas = null;\n    OpenAPI newOas = null;\n    try {\n      oldOas = loadOpenApi(filePaths.get(0));\n      newOas = loadOpenApi(filePaths.get(1));\n    } catch (Exception e) {\n      LOGGER.error(e.getMessage());\n      return;\n    }\n\n    OasSpecDiffValidator diffValidator = createOasSpecDiffValidator();\n\n    List<OasDiffViolation> violations = diffValidator.validate(createContext(oldOas, newOas), oldOas, newOas);\n\n    if (CollectionUtils.isNotEmpty(violations)) {\n      for (OasDiffViolation violation : violations) {\n        LOGGER.info(\"left  : {}\\nright : {}\\nerror : {}\\n------\",\n            OasObjectPropertyLocation.toPathString(violation.getLeftLocation()),\n            OasObjectPropertyLocation.toPathString(violation.getRightLocation()),\n            violation.getError()\n        );\n      }\n      throw new ValidationFailedException(\"check not passed\");\n    }\n    LOGGER.info(\"Everything is good\");\n  }\n\n  private OpenAPI loadOpenApi(String filePath) throws IOException {\n    String yaml = loadFileContent(filePath);\n    SwaggerParseResult oldParseResult = CompatibilityCheckParser.parseYaml(yaml);\n    OpenAPI openAPI = oldParseResult.getOpenAPI();\n    if (openAPI == null) {\n      StringJoiner errors = new StringJoiner(\"\\n\", \"Parse errors:\", \"\");\n      if (CollectionUtils.isNotEmpty(oldParseResult.getMessages())) {\n        for (String message : oldParseResult.getMessages()) {\n          errors.add(message);\n        }\n      }\n      throw new RuntimeException(errors.toString());\n    }\n\n    return openAPI;\n  }\n\n\n  private OasSpecDiffValidator createOasSpecDiffValidator() {\n    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(\n        DefaultOasSpecDiffValidatorFactory.class.getPackage().getName());\n    try {\n      OasSpecDiffValidatorFactory diffValidatorFactory = ctx.getBean(OasSpecDiffValidatorFactory.class);\n      return diffValidatorFactory.create();\n    } finally {\n      ctx.close();\n    }\n  }\n\n\n  private String loadFileContent(String filePath) throws IOException {\n    Path specPath = Paths.get(filePath);\n    specPath.toAbsolutePath().toString();\n    return FileUtils.readFileToString(specPath.toFile());\n  }\n\n  private OasDiffValidationContext createContext(OpenAPI leftOpenAPI, OpenAPI rightOpenAPI) {\n\n    OasDiffValidationContext context = new OasDiffValidationContext(leftOpenAPI, rightOpenAPI);\n    return context;\n  }\n}\n"
  },
  {
    "path": "cli/src/main/java/org/apache/servicecomb/toolkit/cli/CheckStyle.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.cli;\n\nimport io.airlift.airline.Command;\n\n@Command(name = \"checkstyle\",\n    description = \"(Or cs for abbr). Check style for OpenAPI v3 spec yaml.\")\npublic class CheckStyle extends CheckStyleBase {\n\n}\n"
  },
  {
    "path": "cli/src/main/java/org/apache/servicecomb/toolkit/cli/CheckStyleAbbr.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.cli;\n\nimport io.airlift.airline.Command;\n\n@Command(name = \"cs\",\n    description = \"Check style for OpenAPI v3 spec yaml\", hidden = true)\npublic class CheckStyleAbbr extends CheckStyleBase {\n\n}\n"
  },
  {
    "path": "cli/src/main/java/org/apache/servicecomb/toolkit/cli/CheckStyleBase.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.cli;\n\nimport com.google.common.base.Charsets;\nimport io.airlift.airline.Option;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.List;\nimport java.util.Properties;\nimport java.util.StringJoiner;\nimport org.apache.commons.collections4.CollectionUtils;\nimport org.apache.commons.io.FileUtils;\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.style.StyleCheckParser;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.OasSpecValidatorFactory;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.context.annotation.AnnotationConfigApplicationContext;\n\n\npublic class CheckStyleBase implements Runnable {\n\n  private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());\n\n  @Option(name = { \"-r\", \"--rules-file\" }, title = \"rules properties file\", required = true,\n      description = \"rules properties file\")\n  private String rulesFile;\n\n  @Option(name = { \"-f\", \"--file\" }, title = \"OpenAPI v3 spec yaml\", required = true,\n      description = \"OpenAPI v3 spec yaml\")\n  private String filePath;\n\n  @Override\n  public void run() {\n\n    FactoryOptions factoryOptions;\n    try {\n      factoryOptions = loadFactoryOptions();\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n\n    String yaml = null;\n    try {\n      yaml = loadFileContent(filePath);\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n\n    SwaggerParseResult parseResult = StyleCheckParser.parseYaml(yaml);\n    OpenAPI openAPI = parseResult.getOpenAPI();\n    if (openAPI == null) {\n      StringJoiner sj = new StringJoiner(\"\\n\");\n      if (CollectionUtils.isNotEmpty(parseResult.getMessages())) {\n        for (String message : parseResult.getMessages()) {\n          sj.add(message);\n        }\n      }\n      throw new RuntimeException(sj.toString());\n    }\n\n    OasSpecValidator oasSpecValidator = createOasSpecValidator(factoryOptions);\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    if (CollectionUtils.isNotEmpty(violations)) {\n      for (OasViolation violation : violations) {\n        LOGGER.info(\"path  : {}\\nerror : {}\\n------\",\n            OasObjectPropertyLocation.toPathString(violation.getLocation()), violation.getError());\n      }\n      throw new ValidationFailedException(\"check not passed\");\n    }\n    LOGGER.info(\"Everything is good\");\n  }\n\n  private OasSpecValidator createOasSpecValidator(FactoryOptions factoryOptions) {\n\n    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(\n        ValidatorFactoryComponents.class);\n    try {\n      OasSpecValidatorFactory oasSpecValidatorFactory = ctx.getBean(OasSpecValidatorFactory.class);\n      return oasSpecValidatorFactory.create(factoryOptions);\n    } finally {\n      ctx.close();\n    }\n  }\n\n\n  private String loadFileContent(String filePath) throws IOException {\n    Path specPath = Paths.get(filePath);\n    return FileUtils.readFileToString(specPath.toFile(), Charsets.UTF_8);\n  }\n\n  private OasValidationContext createContext(OpenAPI openAPI) {\n\n    OasValidationContext oasValidationContext = new OasValidationContext(openAPI);\n    return oasValidationContext;\n  }\n\n  private FactoryOptions loadFactoryOptions() throws IOException {\n    Path specPath = Paths.get(rulesFile);\n    specPath.toAbsolutePath().toString();\n    Properties properties = new Properties();\n    try (FileInputStream fis = new FileInputStream(specPath.toFile())) {\n      properties.load(fis);\n    }\n    return new FactoryOptions(properties);\n  }\n}\n"
  },
  {
    "path": "cli/src/main/java/org/apache/servicecomb/toolkit/cli/CodeGenerate.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.cli;\n\nimport static org.apache.commons.lang3.StringUtils.isNotEmpty;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.FileVisitResult;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.nio.file.SimpleFileVisitor;\nimport java.nio.file.attribute.BasicFileAttributes;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.Optional;\n\nimport org.apache.servicecomb.toolkit.CodeGenerator;\nimport org.apache.servicecomb.toolkit.GeneratorFactory;\nimport org.apache.servicecomb.toolkit.codegen.ProjectMetaConstant;\nimport org.openapitools.codegen.config.CodegenConfigurator;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport io.airlift.airline.Command;\nimport io.airlift.airline.Option;\n\n@Command(name = \"codegenerate\",\n    description = \"Generate multiple models of microservice project by OpenAPI specification file\")\npublic class CodeGenerate implements Runnable {\n\n  private final static Logger LOGGER = LoggerFactory.getLogger(CodeGenerate.class);\n\n  @Option(name = {\"-p\", \"--programming-model\"}, title = \"programming model\", required = false,\n      description = \"programming model, as SpringMVC, POJO, JAX-RS, and SpringBoot\")\n  private String programmingModel;\n\n  @Option(name = {\"-m\", \"--microservice-framework\"}, title = \"framework\",\n      description = \"microservice-framework\")\n  private String framework = \"ServiceComb\";\n\n  @Option(name = {\"-i\", \"--input\"}, title = \"OpenAPI specification file\", required = true,\n      description = \"location of the OpenAPI specification file, as URL or file (required)\")\n  private String specFile;\n\n  @Option(name = {\"-o\", \"--output\"}, title = \"output directory\",\n      description = \"location of the generated document (current dir by default)\")\n  private String output = \"\";\n\n  @Option(name = {\"--group-id\"}, title = \"group id\",\n      description = \"groupId in generated microservice project\")\n  private String groupId;\n\n  @Option(name = {\"--artifact-id\"}, title = \"artifact id\",\n      description = \"artifact id in generated microservice project\")\n  private String artifactId;\n\n  @Option(name = {\"--artifact-version\"}, title = \"artifact version\",\n      description = \"artifact version in generated microservice project\")\n  private String artifactVersion;\n\n  @Option(name = {\"--api-package\"}, title = \"api package\",\n      description = \"api package in generated microservice project\")\n  private String apiPackage;\n\n  @Option(name = {\"--model-package\"}, title = \"model package\",\n      description = \"model package in generated microservice project\")\n  private String modelPackage;\n\n  @Option(name = {\"-t\", \"--service-type\"}, title = \"service type\",\n      description = \"microservice type of generated microservice project. optional value is provider,consumer,all\")\n  private String serviceType = \"all\";\n\n  @Option(\n      name = {\"--properties\"},\n      title = \"additional properties\",\n      description =\n          \"usage: --properties name=value,name=value. These Properties can be referenced by the mustache templates.\"\n              + \" You can specify one or more value\")\n  private String properties;\n\n  @Override\n  public void run() {\n\n    CodeGenerator codegenerator = GeneratorFactory.getGenerator(CodeGenerator.class, \"default\");\n\n    if (codegenerator == null) {\n      LOGGER.warn(\"Not CodeGenerator found\");\n      return;\n    }\n\n    CodegenConfigurator configurator = new CodegenConfigurator();\n\n    // add additional property\n    Optional.ofNullable(properties).ifPresent(properties ->\n        Arrays.stream(properties.split(\",\")).forEach(property -> {\n          String[] split = property.split(\"=\");\n          if (split != null && split.length == 2) {\n            configurator.addAdditionalProperty(split[0], split[1]);\n          }\n        })\n    );\n\n    configurator.setOutputDir(output)\n        .setGroupId(groupId)\n        .setArtifactId(artifactId)\n        .setArtifactVersion(artifactVersion)\n        .setLibrary(programmingModel)\n        .setGeneratorName(framework)\n        .setApiPackage(apiPackage)\n        .setModelPackage(modelPackage);\n\n    configurator.addAdditionalProperty(ProjectMetaConstant.SERVICE_TYPE, serviceType);\n\n    if (isNotEmpty(specFile)) {\n\n      File contractFile = new File(specFile);\n\n      if (contractFile.isDirectory()) {\n        try {\n          Files.walkFileTree(Paths.get(contractFile.toURI()), new SimpleFileVisitor<Path>() {\n            @Override\n            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n\n              configurator.setInputSpec(file.toFile().getCanonicalPath())\n                  .addAdditionalProperty(\"apiName\", file.toFile().getName().split(\"\\\\.\")[0]);\n\n              try {\n                codegenerator.configure(Collections.singletonMap(\"configurator\", configurator));\n                codegenerator.generate();\n              } catch (RuntimeException e) {\n                throw new RuntimeException(\"Failed to generate code base on file \" + file.toFile().getName());\n              }\n\n              return super.visitFile(file, attrs);\n            }\n          });\n        } catch (RuntimeException | IOException e) {\n          LOGGER.error(e.getMessage());\n          return;\n        }\n      } else {\n        configurator.setInputSpec(specFile).addAdditionalProperty(\"apiName\", contractFile.getName().split(\"\\\\.\")[0]);\n        codegenerator.configure(Collections.singletonMap(\"configurator\", configurator));\n        codegenerator.generate();\n      }\n\n      LOGGER.info(\"Success to generate code, the directory is: {}\", output);\n    }\n  }\n}\n"
  },
  {
    "path": "cli/src/main/java/org/apache/servicecomb/toolkit/cli/DocGenerate.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.cli;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.FileVisitResult;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.nio.file.SimpleFileVisitor;\nimport java.nio.file.attribute.BasicFileAttributes;\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport org.apache.servicecomb.toolkit.DocGenerator;\nimport org.apache.servicecomb.toolkit.GeneratorFactory;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport io.airlift.airline.Command;\nimport io.airlift.airline.Option;\nimport io.swagger.parser.OpenAPIParser;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\n\n@Command(name = \"docgenerate\", description = \"Generate document by OpenAPI specification file\")\npublic class DocGenerate implements Runnable {\n\n  private final static Logger LOGGER = LoggerFactory.getLogger(CodeGenerate.class);\n\n  @Option(name = {\"-i\", \"--input\"}, title = \"OpenAPI specification file\", required = true,\n      description = \"location of the OpenAPI specification file, as URL or file (required)\")\n  private String specFile;\n\n\n  @Option(name = {\"-f\", \"--format\"}, title = \"document format\", required = false,\n      description = \"format of document, as swagger-ui or asciidoc-html (swagger-ui by default)\")\n  private String format = \"swagger-ui\";\n\n  @Option(name = {\"-o\", \"--output\"}, title = \"output directory\",\n      description = \"location of the generated document (current dir by default)\")\n  private String output = \"\";\n\n  @Override\n  public void run() {\n\n    try {\n      Path specPath = Paths.get(specFile);\n\n      String[] fileName = new String[1];\n\n      DocGenerator docGenerator = GeneratorFactory.getGenerator(DocGenerator.class, format);\n      Map<String, Object> docGeneratorConfig = new HashMap<>();\n\n      if (Files.isDirectory(specPath)) {\n\n        Files.walkFileTree(specPath, new SimpleFileVisitor<Path>() {\n          @Override\n          public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n\n            docGeneratorConfig.put(\"contractContent\", parseOpenApi(specPath));\n            docGeneratorConfig.put(\"outputPath\",\n                output + File.separator + file.toFile().getName().substring(0, file.toFile().getName().indexOf(\".\")));\n            docGenerator.configure(docGeneratorConfig);\n            docGenerator.generate();\n\n            return super.visitFile(file, attrs);\n          }\n        });\n      } else if (Files.isRegularFile(specPath)) {\n        fileName[0] = specPath.toFile().getName();\n\n        docGeneratorConfig.put(\"contractContent\", parseOpenApi(specPath));\n        docGeneratorConfig.put(\"outputPath\", output + File.separator + new File(specFile).getName()\n            .substring(0, new File(specFile).getName().indexOf(\".\")));\n        docGenerator.configure(docGeneratorConfig);\n        docGenerator.generate();\n      } else {\n        fileName[0] = specFile;\n\n        docGeneratorConfig.put(\"contractContent\", parseOpenApi(specPath));\n        docGeneratorConfig.put(\"outputPath\", output + File.separator + new File(specFile).getName()\n            .substring(0, new File(specFile).getName().indexOf(\".\")));\n        docGenerator.configure(docGeneratorConfig);\n        docGenerator.generate();\n      }\n\n      LOGGER.info(\"Success to generate document, the directory is: {}\", output);\n    } catch (IOException e) {\n      LOGGER.error(e.getMessage());\n    }\n  }\n\n  public OpenAPI parseOpenApi(Path file) {\n    SwaggerParseResult swaggerParseResult = new OpenAPIParser()\n        .readLocation(file.toString(), null, null);\n    OpenAPI openAPI = swaggerParseResult.getOpenAPI();\n    return openAPI;\n  }\n}\n"
  },
  {
    "path": "cli/src/main/java/org/apache/servicecomb/toolkit/cli/ToolkitMain.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.cli;\n\nimport java.io.IOException;\nimport java.util.Optional;\nimport java.util.Properties;\n\nimport org.apache.commons.lang3.StringUtils;\n\nimport io.airlift.airline.Cli;\nimport io.airlift.airline.Help;\n\npublic class ToolkitMain {\n\n  private static String projectVersion;\n\n  @SuppressWarnings(\"unchecked\")\n  public static void main(String[] args) {\n\n    initialProjectVersion();\n\n    String scriptName = System.getProperty(\"script.name\");\n    Cli.CliBuilder<Runnable> builder = null;\n    if (StringUtils.isNotEmpty(scriptName)) {\n      builder = Cli.builder(scriptName);\n    } else {\n      builder = Cli.builder(\"java -jar cli-\" + projectVersion + \".jar\");\n    }\n\n    builder.withDescription(\"Microservice development toolkit(version \" + projectVersion\n        + \"). \");\n    builder.withDefaultCommand(Help.class);\n    builder.withCommands(\n        CodeGenerate.class, DocGenerate.class,\n        CheckStyle.class, CheckStyleAbbr.class,\n        CheckCompatibility.class, CheckCompatibilityAbbr.class,\n        Help.class\n    );\n    try {\n      Runnable cmd = builder.build().parse(args);\n\n      cmd.run();\n    } catch (ValidationFailedException ex) {\n      ex.printStackTrace(System.err);\n      System.exit(1);\n    }\n  }\n\n  private static void initialProjectVersion() {\n\n    Properties properties = new Properties();\n    try {\n      properties.load(ToolkitMain.class.getClassLoader().getResourceAsStream(\"application.properties\"));\n\n      projectVersion = Optional.ofNullable(properties.getProperty(\"version\")).orElse(\"unknown\");\n    } catch (IOException e) {\n      e.printStackTrace();\n    }\n  }\n}\n"
  },
  {
    "path": "cli/src/main/java/org/apache/servicecomb/toolkit/cli/ValidationFailedException.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\npackage org.apache.servicecomb.toolkit.cli;\n\npublic class ValidationFailedException extends RuntimeException {\n  public ValidationFailedException(String msg) {\n    super(msg);\n  }\n}\n"
  },
  {
    "path": "cli/src/main/resources/application.properties",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nversion=${project.version}"
  },
  {
    "path": "cli/src/main/resources/log4j2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!--this is sample configuration, please modify as your wish-->\n\n<configuration>\n  <Appenders>\n    <Console name=\"Console\" target=\"SYSTEM_OUT\">\n      <PatternLayout pattern=\"%m%n\"/>\n    </Console>\n  </Appenders>\n  <Loggers>\n    <Root level=\"info\">\n      <AppenderRef ref=\"Console\"/>\n    </Root>\n    <Logger name=\"io.swagger\" additivity=\"false\" level=\"error\">\n      <AppenderRef ref=\"Console\"/>\n    </Logger>\n  </Loggers>\n</configuration>"
  },
  {
    "path": "cli/src/test/java/org/apache/servicecomb/toolkit/cli/CliTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.cli;\n\nimport org.junit.Assert;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.contrib.java.lang.system.ExpectedSystemExit;\n\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Arrays;\n\nimport org.apache.commons.io.FileUtils;\n\npublic class CliTest {\n  @Rule\n  public final ExpectedSystemExit exit = ExpectedSystemExit.none();\n\n  @Test\n  public void testGenerateServiceCombCodeFromSingleContract() throws IOException {\n\n    String[] programModels = new String[] {\"SpringMVC\", \"POJO\", \"JAX-RS\", \"SpringBoot\"};\n    Path tempDir = Files.createTempDirectory(null);\n    Arrays.stream(programModels).forEach(model -> {\n      try {\n        Path tempFile = Paths.get(tempDir.toFile().getCanonicalPath() + \"/\" + model + \"Server\");\n        CliTest.class.getClassLoader().getResource(\"swagger.yaml\");\n        String[] args = new String[] {\n            \"codegenerate\",\n            \"-m\",\n            \"ServiceComb\",\n            \"-i\",\n            Paths.get(\"./src/test/resources/swagger.yaml\").toFile().getCanonicalPath(),\n            \"-o\",\n            tempFile.toFile().getCanonicalPath(),\n            \"-p\",\n            model,\n            \"--properties\",\n            \"prop1=value,prop2=value\"\n        };\n        Assert.assertTrue(!Files.exists(tempFile));\n        ToolkitMain.main(args);\n        Assert.assertTrue(Files.exists(tempFile));\n        Assert.assertTrue(FileUtils.sizeOfDirectory(tempFile.toFile()) > 0);\n      } catch (IOException e) {\n        e.printStackTrace();\n      }\n    });\n\n    tempDir.toFile().deleteOnExit();\n  }\n\n  @Test\n  public void testGenerateCodeFromMultiContract() throws IOException {\n\n    Path tempDir = Files.createTempDirectory(null);\n    Path tempFile = Paths.get(tempDir.toFile().getCanonicalPath() + \"/ServiceComb\");\n    String[] args = new String[] {\n        \"codegenerate\",\n        \"-i\",\n        Paths.get(\"./src/test/resources/contracts\").toFile().getCanonicalPath(),\n        \"--artifact-id\",\n        \"ServiceComb\",\n        \"--group-id\",\n        \"org.apache.servicecomb.demo\",\n        \"--artifact-version\",\n        \"0.0.1\",\n        \"--programming-model\",\n        \"SpringMVC\",\n        \"-o\",\n        tempFile.toFile().getCanonicalPath()\n    };\n\n    Assert.assertTrue(!Files.exists(tempFile));\n\n    ToolkitMain.main(args);\n\n    Assert.assertTrue(Files.exists(tempFile));\n    Assert.assertTrue(FileUtils.sizeOfDirectory(tempFile.toFile()) > 0);\n\n    tempDir.toFile().deleteOnExit();\n  }\n\n  @Test\n  public void testCheckStyle() throws IOException {\n    exit.expectSystemExitWithStatus(1);\n    String[] args = new String[] {\n        \"checkstyle\",\n        \"-r\",\n        Paths.get(\"./src/test/resources/oas/style-rules.properties\").toFile().getCanonicalPath(),\n        \"-f\",\n        Paths.get(\"./src/test/resources/oas/style.yaml\").toFile().getCanonicalPath()\n    };\n    ToolkitMain.main(args);\n  }\n\n  @Test\n  public void testCheckStyleAbbr() throws IOException {\n    exit.expectSystemExitWithStatus(1);\n    String[] args = new String[] {\n        \"cs\",\n        \"-r\",\n        Paths.get(\"./src/test/resources/oas/style-rules.properties\").toFile().getCanonicalPath(),\n        \"-f\",\n        Paths.get(\"./src/test/resources/oas/style.yaml\").toFile().getCanonicalPath()\n    };\n    ToolkitMain.main(args);\n  }\n\n  @Test\n  public void testCheckCompatibility() throws IOException {\n    exit.expectSystemExitWithStatus(1);\n    String[] args = new String[] {\n        \"checkcompatibility\",\n        Paths.get(\"./src/test/resources/oas/compatibility-left.yaml\").toFile().getCanonicalPath(),\n        Paths.get(\"./src/test/resources/oas/compatibility-right.yaml\").toFile().getCanonicalPath()\n    };\n    ToolkitMain.main(args);\n  }\n\n  @Test\n  public void testCheckCompatibilityAbbr() throws IOException {\n    exit.expectSystemExitWithStatus(1);\n    String[] args = new String[] {\n        \"cc\",\n        Paths.get(\"./src/test/resources/oas/compatibility-left.yaml\").toFile().getCanonicalPath(),\n        Paths.get(\"./src/test/resources/oas/compatibility-right.yaml\").toFile().getCanonicalPath()\n    };\n    ToolkitMain.main(args);\n  }\n}\n"
  },
  {
    "path": "cli/src/test/resources/contracts/CalculateEndpoint.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n---\nswagger: \"2.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"swagger definition for CalculateEndpoint\"\n  x-java-interface: \"gen.swagger.CalculateEndpointIntf\"\nbasePath: \"/\"\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\npaths:\n  /bmi:\n    get:\n      operationId: \"calculate\"\n      parameters:\n      - name: \"number1\"\n        in: \"query\"\n        required: false\n        type: \"number\"\n        format: \"double\"\n      - name: \"number2\"\n        in: \"query\"\n        required: false\n        type: \"number\"\n        format: \"double\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            $ref: \"#/definitions/CalculateViewObject\"\ndefinitions:\n  CalculateViewObject:\n    type: \"object\"\n    properties:\n      result:\n        type: \"number\"\n        format: \"double\"\n      instanceId:\n        type: \"string\"\n      callTime:\n        type: \"string\"\n    x-java-class: \"CalculateViewObject\"\n"
  },
  {
    "path": "cli/src/test/resources/contracts/HelloEndPoint.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n---\nswagger: \"2.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"swagger definition for HelloEndPoint\"\n  x-java-interface: \"gen.swagger.HelloEndPointIntf\"\nbasePath: \"/hello\"\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\npaths:\n  /sayHello:\n    get:\n      operationId: \"sayHello\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      - name: \"result\"\n        in: \"query\"\n        required: false\n        type: \"number\"\n        format: \"double\"\n      - name: \"instanceId\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      - name: \"callTime\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n  /sayHi:\n    get:\n      operationId: \"sayHi\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      - name: \"Authorization\"\n        in: \"header\"\n        description: \"aa\"\n        required: true\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\""
  },
  {
    "path": "cli/src/test/resources/contracts/pojo/CodeFirstHelloEndPoint.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n---\nswagger: \"2.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"swagger definition for CodeFirstHelloEndPoint\"\n  x-java-interface: \"gen.swagger.CodeFirstHelloEndPointIntf\"\nbasePath: \"/codeFirstHello\"\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\npaths:\n  /sayHello:\n    post:\n      operationId: \"sayHello\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      - name: \"result\"\n        in: \"query\"\n        required: false\n        type: \"number\"\n        format: \"double\"\n      - name: \"instanceId\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      - name: \"callTime\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n  /sayHi:\n    post:\n      operationId: \"sayHi\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      - name: \"Authorization\"\n        in: \"header\"\n        description: \"aa\"\n        required: true\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\""
  },
  {
    "path": "cli/src/test/resources/log4j2-test.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!--this is sample configuration, please modify as your wish-->\n\n<configuration>\n  <loggers>\n    <logger name=\"org.openapitools\" additivity=\"false\" level=\"OFF\">\n    </logger>\n  </loggers>\n</configuration>"
  },
  {
    "path": "cli/src/test/resources/oas/compatibility-left.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "cli/src/test/resources/oas/compatibility-right.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n              bar:\n                contentType: 'application/octet-stream'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "cli/src/test/resources/oas/style-rules.properties",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n# OpenAPI Object\nopenAPI.openapi.gte=3.0.2\nopenAPI.tags.size.gte=1\nopenAPI.security.size.eq=0\n\n# Info Object\ninfo.description.required=true\n\n# Tag Object\ntag.name.case=upper-camel-case\ntag.name.must_be_referenced=true\ntag.description.required=true\n\n# Paths Object\npaths.key.case=lower-camel-case\n\n# Operation Object\noperation.summary.required=true\noperation.operationId.case=lower-camel-case\noperation.tags.size.eq=1\noperation.tags.element.must_reference_root_tags=true\noperations.servers.size.eq=0\n\n# Parameter Object\nparameter.description.required=true\nparameter.name.header.case=upper-hyphen-case\nparameter.name.cookie.case=lower-camel-case\nparameter.name.path.case=lower-camel-case\nparameter.name.query.case=lower-camel-case\n\n# RequestBody Object\nrequestBody.description.required=true\n\n# Response Object\nresponse.headers.key.case=upper-hyphen-case\n\n# Schema Object\nschema.title.required=true\nschema.properties.key.case=lower-camel-case\n\n# Encoding Object\nencoding.headers.key.case=upper-hyphen-case\n\n# Header Object\nheader.description.required=true\n\n# Components Object\ncomponents.schemas.key.case=upper-camel-case\ncomponents.responses.key.case=upper-camel-case\ncomponents.parameters.key.case=upper-camel-case\ncomponents.examples.key.case=upper-camel-case\ncomponents.requestBodies.key.case=upper-camel-case\ncomponents.headers.key.case=upper-hyphen-case\ncomponents.links.key.case=upper-hyphen-case\ncomponents.callbacks.key.case=upper-camel-case\ncomponents.headers.key.case=upper-camel-case\n"
  },
  {
    "path": "cli/src/test/resources/oas/style.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Pet petstore\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "cli/src/test/resources/swagger.yaml",
    "content": "---\nswagger: \"2.0\"\ninfo:\n  description: \"This is a sample server Petstore server.  You can find out more about\\\n    \\ Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\\\n    \\  For this sample, you can use the api key `special-key` to test the authorization\\\n    \\ filters.\"\n  version: \"1.0.0\"\n  title: \"Swagger Petstore\"\n  termsOfService: \"http://swagger.io/terms/\"\n  contact:\n    email: \"apiteam@swagger.io\"\n  license:\n    name: \"Apache 2.0\"\n    url: \"http://www.apache.org/licenses/LICENSE-2.0.html\"\nhost: \"petstore.swagger.io\"\nbasePath: \"/v2\"\ntags:\n- name: \"pet\"\n  description: \"Everything about your Pets\"\n  externalDocs:\n    description: \"Find out more\"\n    url: \"http://swagger.io\"\n- name: \"store\"\n  description: \"Access to Petstore orders\"\n- name: \"user\"\n  description: \"Operations about user\"\n  externalDocs:\n    description: \"Find out more about our store\"\n    url: \"http://swagger.io\"\nschemes:\n- \"https\"\n- \"http\"\npaths:\n  /pet:\n    post:\n      tags:\n      - \"pet\"\n      summary: \"Add a new pet to the store\"\n      description: \"\"\n      operationId: \"addPet\"\n      consumes:\n      - \"application/json\"\n      - \"application/xml\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - in: \"body\"\n        name: \"body\"\n        description: \"Pet object that needs to be added to the store\"\n        required: true\n        schema:\n          $ref: \"#/definitions/Pet\"\n      responses:\n        405:\n          description: \"Invalid input\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n    put:\n      tags:\n      - \"pet\"\n      summary: \"Update an existing pet\"\n      description: \"\"\n      operationId: \"updatePet\"\n      consumes:\n      - \"application/json\"\n      - \"application/xml\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - in: \"body\"\n        name: \"body\"\n        description: \"Pet object that needs to be added to the store\"\n        required: true\n        schema:\n          $ref: \"#/definitions/Pet\"\n      responses:\n        400:\n          description: \"Invalid ID supplied\"\n        404:\n          description: \"Pet not found\"\n        405:\n          description: \"Validation exception\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n  /pet/findByStatus:\n    get:\n      tags:\n      - \"pet\"\n      summary: \"Finds Pets by status\"\n      description: \"Multiple status values can be provided with comma separated strings\"\n      operationId: \"findPetsByStatus\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"status\"\n        in: \"query\"\n        description: \"Status values that need to be considered for filter\"\n        required: true\n        type: \"array\"\n        items:\n          type: \"string\"\n          enum:\n          - \"available\"\n          - \"pending\"\n          - \"sold\"\n          default: \"available\"\n        collectionFormat: \"multi\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            type: \"array\"\n            items:\n              $ref: \"#/definitions/Pet\"\n        400:\n          description: \"Invalid status value\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n  /pet/findByTags:\n    get:\n      tags:\n      - \"pet\"\n      summary: \"Finds Pets by tags\"\n      description: \"Multiple tags can be provided with comma separated strings. Use\\\n        \\ tag1, tag2, tag3 for testing.\"\n      operationId: \"findPetsByTags\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"tags\"\n        in: \"query\"\n        description: \"Tags to filter by\"\n        required: true\n        type: \"array\"\n        items:\n          type: \"string\"\n        collectionFormat: \"multi\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            type: \"array\"\n            items:\n              $ref: \"#/definitions/Pet\"\n        400:\n          description: \"Invalid tag value\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n      deprecated: true\n  /pet/{petId}:\n    get:\n      tags:\n      - \"pet\"\n      summary: \"Find pet by ID\"\n      description: \"Returns a single pet\"\n      operationId: \"getPetById\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"petId\"\n        in: \"path\"\n        description: \"ID of pet to return\"\n        required: true\n        type: \"integer\"\n        format: \"int64\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            $ref: \"#/definitions/Pet\"\n        400:\n          description: \"Invalid ID supplied\"\n        404:\n          description: \"Pet not found\"\n      security:\n      - api_key: []\n    post:\n      tags:\n      - \"pet\"\n      summary: \"Updates a pet in the store with form data\"\n      description: \"\"\n      operationId: \"updatePetWithForm\"\n      consumes:\n      - \"application/x-www-form-urlencoded\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"petId\"\n        in: \"path\"\n        description: \"ID of pet that needs to be updated\"\n        required: true\n        type: \"integer\"\n        format: \"int64\"\n      - name: \"name\"\n        in: \"formData\"\n        description: \"Updated name of the pet\"\n        required: false\n        type: \"string\"\n      - name: \"status\"\n        in: \"formData\"\n        description: \"Updated status of the pet\"\n        required: false\n        type: \"string\"\n      responses:\n        405:\n          description: \"Invalid input\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n    delete:\n      tags:\n      - \"pet\"\n      summary: \"Deletes a pet\"\n      description: \"\"\n      operationId: \"deletePet\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"api_key\"\n        in: \"header\"\n        required: false\n        type: \"string\"\n      - name: \"petId\"\n        in: \"path\"\n        description: \"Pet id to delete\"\n        required: true\n        type: \"integer\"\n        format: \"int64\"\n      responses:\n        400:\n          description: \"Invalid ID supplied\"\n        404:\n          description: \"Pet not found\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n  /pet/{petId}/uploadImage:\n    post:\n      tags:\n      - \"pet\"\n      summary: \"uploads an image\"\n      description: \"\"\n      operationId: \"uploadFile\"\n      consumes:\n      - \"multipart/form-data\"\n      produces:\n      - \"application/json\"\n      parameters:\n      - name: \"petId\"\n        in: \"path\"\n        description: \"ID of pet to update\"\n        required: true\n        type: \"integer\"\n        format: \"int64\"\n      - name: \"additionalMetadata\"\n        in: \"formData\"\n        description: \"Additional data to pass to server\"\n        required: false\n        type: \"string\"\n      - name: \"file\"\n        in: \"formData\"\n        description: \"file to upload\"\n        required: false\n        type: \"file\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            $ref: \"#/definitions/ApiResponse\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n  /store/inventory:\n    get:\n      tags:\n      - \"store\"\n      summary: \"Returns pet inventories by status\"\n      description: \"Returns a map of status codes to quantities\"\n      operationId: \"getInventory\"\n      produces:\n      - \"application/json\"\n      parameters: []\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            type: \"object\"\n            additionalProperties:\n              type: \"integer\"\n              format: \"int32\"\n      security:\n      - api_key: []\n  /store/order:\n    post:\n      tags:\n      - \"store\"\n      summary: \"Place an order for a pet\"\n      description: \"\"\n      operationId: \"placeOrder\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - in: \"body\"\n        name: \"body\"\n        description: \"order placed for purchasing the pet\"\n        required: true\n        schema:\n          $ref: \"#/definitions/Order\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            $ref: \"#/definitions/Order\"\n        400:\n          description: \"Invalid Order\"\n  /store/order/{orderId}:\n    get:\n      tags:\n      - \"store\"\n      summary: \"Find purchase order by ID\"\n      description: \"For valid response try integer IDs with value >= 1 and <= 10.\\\n        \\ Other values will generated exceptions\"\n      operationId: \"getOrderById\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"orderId\"\n        in: \"path\"\n        description: \"ID of pet that needs to be fetched\"\n        required: true\n        type: \"integer\"\n        maximum: 10.0\n        minimum: 1.0\n        format: \"int64\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            $ref: \"#/definitions/Order\"\n        400:\n          description: \"Invalid ID supplied\"\n        404:\n          description: \"Order not found\"\n    delete:\n      tags:\n      - \"store\"\n      summary: \"Delete purchase order by ID\"\n      description: \"For valid response try integer IDs with positive integer value.\\\n        \\ Negative or non-integer values will generate API errors\"\n      operationId: \"deleteOrder\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"orderId\"\n        in: \"path\"\n        description: \"ID of the order that needs to be deleted\"\n        required: true\n        type: \"integer\"\n        minimum: 1.0\n        format: \"int64\"\n      responses:\n        400:\n          description: \"Invalid ID supplied\"\n        404:\n          description: \"Order not found\"\n  /user:\n    post:\n      tags:\n      - \"user\"\n      summary: \"Create user\"\n      description: \"This can only be done by the logged in user.\"\n      operationId: \"createUser\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - in: \"body\"\n        name: \"body\"\n        description: \"Created user object\"\n        required: true\n        schema:\n          $ref: \"#/definitions/User\"\n      responses:\n        default:\n          description: \"successful operation\"\n  /user/createWithArray:\n    post:\n      tags:\n      - \"user\"\n      summary: \"Creates list of users with given input array\"\n      description: \"\"\n      operationId: \"createUsersWithArrayInput\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - in: \"body\"\n        name: \"body\"\n        description: \"List of user object\"\n        required: true\n        schema:\n          type: \"array\"\n          items:\n            $ref: \"#/definitions/User\"\n      responses:\n        default:\n          description: \"successful operation\"\n  /user/createWithList:\n    post:\n      tags:\n      - \"user\"\n      summary: \"Creates list of users with given input array\"\n      description: \"\"\n      operationId: \"createUsersWithListInput\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - in: \"body\"\n        name: \"body\"\n        description: \"List of user object\"\n        required: true\n        schema:\n          type: \"array\"\n          items:\n            $ref: \"#/definitions/User\"\n      responses:\n        default:\n          description: \"successful operation\"\n  /user/login:\n    get:\n      tags:\n      - \"user\"\n      summary: \"Logs user into the system\"\n      description: \"\"\n      operationId: \"loginUser\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"username\"\n        in: \"query\"\n        description: \"The user name for login\"\n        required: true\n        type: \"string\"\n      - name: \"password\"\n        in: \"query\"\n        description: \"The password for login in clear text\"\n        required: true\n        type: \"string\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            type: \"string\"\n          headers:\n            X-Rate-Limit:\n              type: \"integer\"\n              format: \"int32\"\n              description: \"calls per hour allowed by the user\"\n            X-Expires-After:\n              type: \"string\"\n              format: \"date-time\"\n              description: \"date in UTC when token expires\"\n        400:\n          description: \"Invalid username/password supplied\"\n  /user/logout:\n    get:\n      tags:\n      - \"user\"\n      summary: \"Logs out current logged in user session\"\n      description: \"\"\n      operationId: \"logoutUser\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters: []\n      responses:\n        default:\n          description: \"successful operation\"\n  /user/{username}:\n    get:\n      tags:\n      - \"user\"\n      summary: \"Get user by user name\"\n      description: \"\"\n      operationId: \"getUserByName\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"username\"\n        in: \"path\"\n        description: \"The name that needs to be fetched. Use user1 for testing. \"\n        required: true\n        type: \"string\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            $ref: \"#/definitions/User\"\n        400:\n          description: \"Invalid username supplied\"\n        404:\n          description: \"User not found\"\n    put:\n      tags:\n      - \"user\"\n      summary: \"Updated user\"\n      description: \"This can only be done by the logged in user.\"\n      operationId: \"updateUser\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"username\"\n        in: \"path\"\n        description: \"name that need to be updated\"\n        required: true\n        type: \"string\"\n      - in: \"body\"\n        name: \"body\"\n        description: \"Updated user object\"\n        required: true\n        schema:\n          $ref: \"#/definitions/User\"\n      responses:\n        400:\n          description: \"Invalid user supplied\"\n        404:\n          description: \"User not found\"\n    delete:\n      tags:\n      - \"user\"\n      summary: \"Delete user\"\n      description: \"This can only be done by the logged in user.\"\n      operationId: \"deleteUser\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"username\"\n        in: \"path\"\n        description: \"The name that needs to be deleted\"\n        required: true\n        type: \"string\"\n      responses:\n        400:\n          description: \"Invalid username supplied\"\n        404:\n          description: \"User not found\"\nsecurityDefinitions:\n  petstore_auth:\n    type: \"oauth2\"\n    authorizationUrl: \"https://petstore.swagger.io/oauth/authorize\"\n    flow: \"implicit\"\n    scopes:\n      write:pets: \"modify pets in your account\"\n      read:pets: \"read your pets\"\n  api_key:\n    type: \"apiKey\"\n    name: \"api_key\"\n    in: \"header\"\ndefinitions:\n  Order:\n    type: \"object\"\n    properties:\n      id:\n        type: \"integer\"\n        format: \"int64\"\n      petId:\n        type: \"integer\"\n        format: \"int64\"\n      quantity:\n        type: \"integer\"\n        format: \"int32\"\n      shipDate:\n        type: \"string\"\n        format: \"date-time\"\n      status:\n        type: \"string\"\n        description: \"Order Status\"\n        enum:\n        - \"placed\"\n        - \"approved\"\n        - \"delivered\"\n      complete:\n        type: \"boolean\"\n        default: false\n    xml:\n      name: \"Order\"\n  User:\n    type: \"object\"\n    properties:\n      id:\n        type: \"integer\"\n        format: \"int64\"\n      username:\n        type: \"string\"\n      firstName:\n        type: \"string\"\n      lastName:\n        type: \"string\"\n      email:\n        type: \"string\"\n      password:\n        type: \"string\"\n      phone:\n        type: \"string\"\n      userStatus:\n        type: \"integer\"\n        format: \"int32\"\n        description: \"User Status\"\n    xml:\n      name: \"User\"\n  Category:\n    type: \"object\"\n    properties:\n      id:\n        type: \"integer\"\n        format: \"int64\"\n      name:\n        type: \"string\"\n    xml:\n      name: \"Category\"\n  Tag:\n    type: \"object\"\n    properties:\n      id:\n        type: \"integer\"\n        format: \"int64\"\n      name:\n        type: \"string\"\n    xml:\n      name: \"Tag\"\n  Pet:\n    type: \"object\"\n    required:\n    - \"name\"\n    - \"photoUrls\"\n    properties:\n      id:\n        type: \"integer\"\n        format: \"int64\"\n      category:\n        $ref: \"#/definitions/Category\"\n      name:\n        type: \"string\"\n        example: \"doggie\"\n      photoUrls:\n        type: \"array\"\n        xml:\n          name: \"photoUrl\"\n          wrapped: true\n        items:\n          type: \"string\"\n      tags:\n        type: \"array\"\n        xml:\n          name: \"tag\"\n          wrapped: true\n        items:\n          $ref: \"#/definitions/Tag\"\n      status:\n        type: \"string\"\n        description: \"pet status in the store\"\n        enum:\n        - \"available\"\n        - \"pending\"\n        - \"sold\"\n    xml:\n      name: \"Pet\"\n  ApiResponse:\n    type: \"object\"\n    properties:\n      code:\n        type: \"integer\"\n        format: \"int32\"\n      type:\n        type: \"string\"\n      message:\n        type: \"string\"\nexternalDocs:\n  description: \"Find out more about Swagger\"\n  url: \"http://swagger.io\"\n"
  },
  {
    "path": "codegen/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>toolkit</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>codegen</artifactId>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>core</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>io.swagger</groupId>\n      <artifactId>swagger-codegen</artifactId>\n      <exclusions>\n        <exclusion>\n          <groupId>org.checkerframework</groupId>\n          <artifactId>checker-compat-qual</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>com.google.guava</groupId>\n          <artifactId>listenablefuture</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>org.slf4j</groupId>\n          <artifactId>slf4j-simple</artifactId>\n        </exclusion>\n      </exclusions>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-slf4j-impl</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-api</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-core</artifactId>\n    </dependency>\n\n    <dependency><!-- 桥接：告诉commons logging使用Log4j2 -->\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-jcl</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>junit</groupId>\n      <artifactId>junit</artifactId>\n      <scope>test</scope>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n      </plugin>\n    </plugins>\n\n    <resources>\n      <resource>\n        <directory>src/main/resources</directory>\n        <includes>\n          <include>**/*.*</include>\n        </includes>\n      </resource>\n    </resources>\n  </build>\n</project>\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/AbstractConsumerDirectoryStrategy.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.util.List;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.openapitools.codegen.SupportingFile;\n\npublic abstract class AbstractConsumerDirectoryStrategy extends AbstractDirectoryStrategy {\n\n  @Override\n  public void processSupportingFile(List<SupportingFile> supportingFiles) {\n    correctServiceId();\n  }\n\n  private void correctServiceId() {\n    String serviceId = (String) propertiesMap.get(ProjectMetaConstant.SERVICE_ID);\n    propertiesMap.computeIfAbsent(GeneratorExternalConfigConstant.CONSUMER_SERVICE_ID, key -> {\n      if (StringUtils.isNotEmpty(serviceId)) {\n        return serviceId;\n      }\n      return propertiesMap.get(\"artifactId\");\n    });\n    propertiesMap.computeIfAbsent(GeneratorExternalConfigConstant.PROVIDER_SERVICE_ID, key -> {\n      throw new UnsupportedOperationException(\"In consumer type, providerServiceId is required\");\n    });\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/AbstractDirectoryStrategy.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.io.File;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\n\nimport org.openapitools.codegen.SupportingFile;\n\npublic abstract class AbstractDirectoryStrategy implements DirectoryStrategy<List<SupportingFile>> {\n\n  protected Map<String, Object> propertiesMap = Collections.emptyMap();\n\n  protected String projectFolder = \"src\" + File.separator + \"main\";\n\n  protected String sourceFolder = projectFolder + File.separator + \"java\";\n\n  @Override\n  public void addCustomProperties(Map<String, Object> propertiesMap) {\n    this.propertiesMap = propertiesMap;\n  }\n\n  protected String mainClassFolder(String projectPath) {\n    return projectPath + File.separator + sourceFolder + File.separator + ((String) propertiesMap\n        .get(\"mainClassPackage\")).replace(\".\", File.separator);\n  }\n\n  protected String resourcesFolder(String projectPath) {\n    return projectPath + File.separator + projectFolder + File.separator + \"resources\";\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/AbstractJavaCodegenExt.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.util.LinkedHashMap;\nimport java.util.List;\nimport java.util.Map;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.openapitools.codegen.CodegenModel;\nimport org.openapitools.codegen.CodegenProperty;\nimport org.openapitools.codegen.languages.AbstractJavaCodegen;\nimport org.openapitools.codegen.languages.SpringCodegen;\n\npublic abstract class AbstractJavaCodegenExt extends AbstractJavaCodegen {\n\n  protected final Map<String, DirectoryStrategy> directoryStrategyMap = new LinkedHashMap<>();\n\n  protected DirectoryStrategy currentDirectoryStrategy;\n\n  protected String mainClassPackage;\n\n  public AbstractJavaCodegenExt() {\n\n    modelDocTemplateFiles.remove(\"model_doc.mustache\");\n    apiDocTemplateFiles.remove(\"api_doc.mustache\");\n    apiTestTemplateFiles.remove(\"api_test.mustache\");\n\n    groupId = \"domain.orgnization.project\";\n    artifactId = \"sample\";\n\n    apiPackage = groupId + \".\" + artifactId + \".api\";\n    modelPackage = groupId + \".\" + artifactId + \".model\";\n    mainClassPackage = groupId + \".\" + artifactId;\n  }\n\n  @Override\n  public void processOpts() {\n    super.processOpts();\n    if (StringUtils.isEmpty((String) additionalProperties.get(\"mainClassPackage\"))) {\n      mainClassPackage = apiPackage.substring(0, apiPackage.lastIndexOf(\".\"));\n      additionalProperties.put(\"mainClassPackage\", mainClassPackage);\n    } else {\n      mainClassPackage = (String) additionalProperties.get(\"mainClassPackage\");\n    }\n  }\n\n  @Override\n  public Map<String, Object> postProcessModelsEnum(Map<String, Object> objs) {\n    objs = super.postProcessModelsEnum(objs);\n    SpringCodegen springCodegen = new SpringCodegen();\n    return springCodegen.postProcessModelsEnum(objs);\n  }\n\n  @Override\n  public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<Object> allModels) {\n    SpringCodegen springCodegen = new SpringCodegen();\n    return springCodegen.postProcessOperationsWithModels(objs, allModels);\n  }\n\n  @Override\n  public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {\n    super.postProcessModelProperty(model, property);\n    model.imports.remove(\"ApiModelProperty\");\n    model.imports.remove(\"ApiModel\");\n  }\n\n\n  /**\n   * Register a custom VersionStrategy to apply to resource URLs that match the\n   * given path patterns.\n   * @param strategy the custom strategy\n   * @param serviceTypes one or more service type,\n   * relative to the service type that represent microservice type of generated microservice project\n   * @see DirectoryStrategy\n   */\n  public void addDirectoryStrategy(DirectoryStrategy strategy, String... serviceTypes) {\n    for (String serviceType : serviceTypes) {\n      getStrategyMap().put(serviceType, strategy);\n    }\n  }\n\n  /**\n   * Return the map with directory strategies keyed by service type.\n   */\n  public Map<String, DirectoryStrategy> getStrategyMap() {\n    return this.directoryStrategyMap;\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/AbstractMultiDirectoryStrategy.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.util.List;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.openapitools.codegen.SupportingFile;\n\npublic abstract class AbstractMultiDirectoryStrategy extends AbstractDirectoryStrategy {\n\n  @Override\n  public void processSupportingFile(List<SupportingFile> supportingFiles) {\n    correctServiceId();\n  }\n\n  private void correctServiceId() {\n\n    String serviceId = (String) propertiesMap.get(ProjectMetaConstant.SERVICE_ID);\n    propertiesMap.computeIfAbsent(GeneratorExternalConfigConstant.CONSUMER_SERVICE_ID, key -> {\n      if (StringUtils.isNotEmpty(serviceId)) {\n        return String.format(\"%s-consumer\", serviceId);\n      }\n      return consumerDirectory();\n    });\n    propertiesMap.computeIfAbsent(GeneratorExternalConfigConstant.PROVIDER_SERVICE_ID, key -> {\n      if (StringUtils.isNotEmpty(serviceId)) {\n        return serviceId;\n      }\n      return providerDirectory();\n    });\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/AbstractProviderDirectoryStrategy.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.util.List;\n\nimport org.openapitools.codegen.SupportingFile;\n\npublic abstract class AbstractProviderDirectoryStrategy extends AbstractDirectoryStrategy {\n\n  @Override\n  public void processSupportingFile(List<SupportingFile> supportingFiles) {\n    correctServiceId();\n  }\n\n  private void correctServiceId() {\n    propertiesMap\n        .computeIfAbsent(GeneratorExternalConfigConstant.PROVIDER_SERVICE_ID, key -> propertiesMap.get(\"artifactId\"));\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/ConsumerDirectoryStrategy.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport org.openapitools.codegen.SupportingFile;\n\npublic class ConsumerDirectoryStrategy extends AbstractConsumerDirectoryStrategy {\n\n  private String consumerTemplateFolder = \"consumer\";\n\n  private String apiConsumerTemplate = consumerTemplateFolder + \"/apiConsumer.mustache\";\n\n  private String apiConsumerTemplateForPojo = consumerTemplateFolder + \"/pojo/apiConsumer.mustache\";\n\n  private String apiInterfaceTemplateForPojo = consumerTemplateFolder + \"/pojo/apiInterface.mustache\";\n\n  @Override\n  public String modelDirectory() {\n    return consumerDirectory();\n  }\n\n  @Override\n  public String providerDirectory() {\n    throw new UnsupportedOperationException();\n  }\n\n  @Override\n  public String consumerDirectory() {\n    return (String) propertiesMap.get(\"artifactId\");\n  }\n\n  @Override\n  public void processSupportingFile(List<SupportingFile> supportingFiles) {\n\n    super.processSupportingFile(supportingFiles);\n    String newConsumerTemplateFolder = consumerTemplateFolder;\n\n    if (ServiceCombCodegen.SPRING_BOOT_LIBRARY.equals(propertiesMap.get(\"library\"))) {\n      newConsumerTemplateFolder += \"/springboot\";\n    }\n\n    supportingFiles.add(new SupportingFile(newConsumerTemplateFolder + \"/pom.mustache\",\n        consumerDirectory(),\n        \"pom.xml\")\n    );\n\n    supportingFiles.add(new SupportingFile(newConsumerTemplateFolder + \"/Application.mustache\",\n        mainClassFolder(consumerDirectory()),\n        \"Application.java\")\n    );\n\n    supportingFiles.add(new SupportingFile(\"log4j2.mustache\",\n        resourcesFolder(consumerDirectory()),\n        \"log4j2.xml\")\n    );\n\n    supportingFiles.add(new SupportingFile(consumerTemplateFolder + \"/microservice.mustache\",\n        resourcesFolder(consumerDirectory()),\n        \"microservice.yaml\")\n    );\n\n    propertiesMap\n        .computeIfAbsent(GeneratorExternalConfigConstant.CONSUMER_ARTIFACT_ID, k -> propertiesMap.get(\"artifactId\"));\n\n    propertiesMap.put(\"apiConsumerTemplate\", apiConsumerTemplate);\n    propertiesMap.put(\"apiConsumerTemplateForPojo\", apiConsumerTemplateForPojo);\n    Map<String, String> apiTemplateFiles = ((Map<String, String>) propertiesMap.get(\"apiTemplateFiles\"));\n    apiTemplateFiles.remove(\"api.mustache\");\n    if (ServiceCombCodegen.POJO_LIBRARY.equals(propertiesMap.get(\"library\"))) {\n      apiTemplateFiles.put(apiConsumerTemplateForPojo, \"Consumer.java\");\n      apiTemplateFiles.put(apiInterfaceTemplateForPojo, \".java\");\n      propertiesMap.put(\"isPOJO\", true);\n    } else {\n      apiTemplateFiles.put(apiConsumerTemplate, \".java\");\n    }\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/DefaultCodeGenerator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport org.apache.servicecomb.toolkit.CodeGenerator;\nimport org.openapitools.codegen.config.CodegenConfigurator;\n\npublic class DefaultCodeGenerator implements CodeGenerator {\n\n  private MultiContractGenerator generator = new MultiContractGenerator();\n\n  @Override\n  public boolean canProcess(String type) {\n    return \"default\".equals(type);\n  }\n\n  @Override\n  public void configure(Map<String, Object> config) {\n\n    generator.setGenerateMetadata(false);\n    List<CodegenConfigurator> optsList = (List<CodegenConfigurator>) config.get(\"configurators\");\n    if (optsList == null) {\n      generator.addOpts(((CodegenConfigurator) config.get(\"configurator\")).toClientOptInput());\n      return;\n    }\n    optsList.forEach(opts -> {\n      generator.addOpts(opts.toClientOptInput());\n    });\n  }\n\n  @Override\n  public void generate() {\n    generator.generate();\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/DefaultDirectoryStrategy.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\n\nimport org.openapitools.codegen.SupportingFile;\n\npublic class DefaultDirectoryStrategy extends AbstractMultiDirectoryStrategy {\n\n  protected String providerTemplateFolder = \"provider\";\n\n  private String consumerTemplateFolder = \"consumer\";\n\n  private String apiConsumerTemplate = consumerTemplateFolder + \"/apiConsumer.mustache\";\n\n  private String apiConsumerTemplateForPojo = consumerTemplateFolder + \"/pojo/apiConsumer.mustache\";\n\n  private String apiInterfaceTemplateForPojo = consumerTemplateFolder + \"/pojo/apiInterface.mustache\";\n\n  @Override\n  public String modelDirectory() {\n    return Optional.ofNullable((String) propertiesMap.get(GeneratorExternalConfigConstant.MODEL_PROJECT_NAME))\n        .orElse(\"model\");\n  }\n\n  @Override\n  public String providerDirectory() {\n    return Optional.ofNullable((String) propertiesMap.get(GeneratorExternalConfigConstant.PROVIDER_PROJECT_NAME))\n        .orElse(\"provider\");\n  }\n\n  @Override\n  public String consumerDirectory() {\n    return Optional.ofNullable((String) propertiesMap.get(GeneratorExternalConfigConstant.CONSUMER_PROJECT_NAME))\n        .orElse(\"consumer\");\n  }\n\n  @Override\n  public void processSupportingFile(List<SupportingFile> supportingFiles) {\n    super.processSupportingFile(supportingFiles);\n    processProvider(supportingFiles);\n    processConsumer(supportingFiles);\n    processModel(supportingFiles);\n    processParentProjectOpts(supportingFiles);\n    propertiesMap.put(\"isMultipleModule\", true);\n  }\n\n  private void processParentProjectOpts(List<SupportingFile> supportingFiles) {\n\n    supportingFiles.add(new SupportingFile(\"project/pom.mustache\",\n        \"\",\n        \"pom.xml\")\n    );\n  }\n\n  private void processModel(List<SupportingFile> supportingFiles) {\n\n    propertiesMap.computeIfAbsent(GeneratorExternalConfigConstant.MODEL_ARTIFACT_ID, k -> modelDirectory());\n\n    supportingFiles.add(new SupportingFile(\"model/pom.mustache\",\n        modelDirectory(),\n        \"pom.xml\")\n    );\n  }\n\n  private void processConsumer(List<SupportingFile> supportingFiles) {\n\n    String newConsumerTemplateFolder = consumerTemplateFolder;\n\n    if (ServiceCombCodegen.SPRING_BOOT_LIBRARY.equals(propertiesMap.get(\"library\"))) {\n      newConsumerTemplateFolder += \"/springboot\";\n    }\n\n    supportingFiles.add(new SupportingFile(newConsumerTemplateFolder + \"/pom.mustache\",\n        consumerDirectory(),\n        \"pom.xml\")\n    );\n\n    supportingFiles.add(new SupportingFile(newConsumerTemplateFolder + \"/Application.mustache\",\n        mainClassFolder(consumerDirectory()),\n        \"Application.java\")\n    );\n\n    supportingFiles.add(new SupportingFile(\"log4j2.mustache\",\n        resourcesFolder(consumerDirectory()),\n        \"log4j2.xml\")\n    );\n\n    supportingFiles.add(new SupportingFile(consumerTemplateFolder + \"/microservice.mustache\",\n        resourcesFolder(consumerDirectory()),\n        \"microservice.yaml\")\n    );\n\n    propertiesMap\n        .computeIfAbsent(GeneratorExternalConfigConstant.CONSUMER_ARTIFACT_ID, k -> consumerDirectory());\n\n//    propertiesMap.put(\"apiConsumerTemplate\", apiConsumerTemplate);\n    propertiesMap.put(apiConsumerTemplate, ServiceType.CONSUMER.getValue());\n    Map<String, String> apiTemplateFiles = ((Map<String, String>) propertiesMap.get(\"apiTemplateFiles\"));\n    if (ServiceCombCodegen.POJO_LIBRARY.equals(propertiesMap.get(\"library\"))) {\n      apiTemplateFiles.put(apiConsumerTemplateForPojo, \"Consumer.java\");\n      propertiesMap.put(apiConsumerTemplateForPojo, ServiceType.CONSUMER.getValue());\n      apiTemplateFiles.put(apiInterfaceTemplateForPojo, \".java\");\n      propertiesMap.put(apiInterfaceTemplateForPojo, ServiceType.CONSUMER.getValue());\n      propertiesMap.put(\"isPOJO\", true);\n    } else {\n      apiTemplateFiles.put(apiConsumerTemplate, \".java\");\n    }\n  }\n\n  private void processProvider(List<SupportingFile> supportingFiles) {\n    supportingFiles.add(new SupportingFile(\"pom.mustache\",\n        providerDirectory(),\n        \"pom.xml\")\n    );\n\n    supportingFiles.add(new SupportingFile(\"Application.mustache\",\n        mainClassFolder(providerDirectory()),\n        \"Application.java\")\n    );\n\n    supportingFiles.add(new SupportingFile(\"log4j2.mustache\",\n        resourcesFolder(providerDirectory()),\n        \"log4j2.xml\")\n    );\n\n    supportingFiles.add(new SupportingFile(providerTemplateFolder + \"/microservice.mustache\",\n        resourcesFolder(providerDirectory()),\n        \"microservice.yaml\")\n    );\n\n    propertiesMap\n        .computeIfAbsent(GeneratorExternalConfigConstant.PROVIDER_ARTIFACT_ID, k -> providerDirectory());\n\n    if (ServiceCombCodegen.POJO_LIBRARY.equals(propertiesMap.get(\"library\"))) {\n//      ((Map<String, String>) propertiesMap.get(\"apiTemplateFiles\")).put(pojoApiImplTemplate, \".java\");\n      propertiesMap.put(\"isPOJO\", true);\n    }\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/DirectoryStrategy.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.util.Map;\n\npublic interface DirectoryStrategy<T> {\n\n  String modelDirectory();\n\n  String providerDirectory();\n\n  String consumerDirectory();\n\n  void processSupportingFile(T t);\n\n  void addCustomProperties(Map<String, Object> propertiesMap);\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/GeneratorExternalConfigConstant.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\npublic class GeneratorExternalConfigConstant {\n\n  public final static String PROVIDER_PROJECT_NAME = \"providerProjectName\";\n\n  public final static String CONSUMER_PROJECT_NAME = \"consumerProjectName\";\n\n  public final static String MODEL_PROJECT_NAME = \"modelProjectName\";\n\n  public final static String PROVIDER_ARTIFACT_ID = \"providerArtifactId\";\n\n  public final static String CONSUMER_ARTIFACT_ID = \"consumerArtifactId\";\n\n  public final static String MODEL_ARTIFACT_ID = \"modelArtifactId\";\n\n  public final static String MICRO_SERVICE_FRAMEWORK = \"microServiceFramework\";\n\n  public final static String PROVIDER_SERVICE_ID = \"providerServiceId\";\n\n  public final static String CONSUMER_SERVICE_ID = \"consumerServiceId\";\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/GetGenericClassTypeLambda.java",
    "content": "/*\r\n * Licensed to the Apache Software Foundation (ASF) under one or more\r\n * contributor license agreements.  See the NOTICE file distributed with\r\n * this work for additional information regarding copyright ownership.\r\n * The ASF licenses this file to You under the Apache License, Version 2.0\r\n * (the \"License\"); you may not use this file except in compliance with\r\n * the License.  You may obtain a copy of the License at\r\n *\r\n *     http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\npackage org.apache.servicecomb.toolkit.codegen;\r\n\r\nimport java.io.IOException;\r\nimport java.io.Writer;\r\n\r\nimport com.samskivert.mustache.Mustache;\r\nimport com.samskivert.mustache.Template;\r\n\r\n\r\npublic class GetGenericClassTypeLambda implements Mustache.Lambda {\r\n  @Override\r\n  public void execute(Template.Fragment fragment, Writer writer) throws IOException {\r\n    String text = fragment.execute();\r\n    if (text.contains(\"<\")) {\r\n      String className = text.substring(0, text.indexOf(\"<\"));\r\n      text = \"(Class<\" + text + \">)(Class)\" + className;\r\n    }\r\n    writer.write(text);\r\n  }\r\n}\r\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/GetRelativeBasePathLambda.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.io.IOException;\nimport java.io.Writer;\n\nimport com.samskivert.mustache.Mustache;\nimport com.samskivert.mustache.Template.Fragment;\n\npublic class GetRelativeBasePathLambda implements Mustache.Lambda {\n\n  private static String HOST_PORT_PATTERN = \"(\\\\w+://)([\\\\w\\\\.]+)?(:\\\\d*)?/?\";\n\n  @Override\n  public void execute(Fragment fragment, Writer writer) throws IOException {\n\n    String text = fragment.execute();\n    String relativeBasePath = text.replaceAll(HOST_PORT_PATTERN, \"/\");\n    writer.write(relativeBasePath);\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/MicroServiceFramework.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\npublic enum MicroServiceFramework {\n\n  // ServiceComb\n  SERVICECOMB,\n\n  // SpringCloud\n  SPRINGCLOUD\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/MultiContractGenerator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.Set;\n\nimport org.openapitools.codegen.ClientOptInput;\nimport org.openapitools.codegen.DefaultGenerator;\nimport org.openapitools.codegen.Generator;\n\npublic class MultiContractGenerator extends DefaultGenerator {\n\n  private List<ClientOptInput> optsList = new ArrayList<>();\n\n  public Generator addOpts(ClientOptInput opts) {\n    optsList.add(opts);\n    return this;\n  }\n\n  public void generateParentProject(List<File> files, List<Map<String, Object>> modules) {\n\n    this.config = optsList.get(0).getConfig();\n    String outputFilename = opts.getConfig().outputFolder() + File.separator + \"pom.xml\";\n\n    if (!config.shouldOverwrite(outputFilename)) {\n      LOGGER.info(\"Skipped overwriting \" + outputFilename);\n    }\n    Map<String, Object> templateData = this.config.additionalProperties();\n    templateData.put(\"modules\", modules);\n    try {\n      files.add(processTemplateToFile(templateData, \"project/pom.mustache\", outputFilename));\n    } catch (IOException e) {\n      throw new RuntimeException(\"Failed to generate parent project pom.xml\", e);\n    }\n  }\n\n  @Override\n  public List<File> generate() {\n\n    if (optsList == null || optsList.size() == 0) {\n      return null;\n    }\n\n    List<File> fileList = new ArrayList<>();\n    List<Map<String, Object>> modules = new ArrayList<>();\n\n    Set<Object> moduleSet = new HashSet<>();\n    for (ClientOptInput opts : optsList) {\n      moduleSet.add(opts.getConfig().additionalProperties().get(GeneratorExternalConfigConstant.PROVIDER_PROJECT_NAME));\n      moduleSet.add(opts.getConfig().additionalProperties().get(GeneratorExternalConfigConstant.CONSUMER_PROJECT_NAME));\n      moduleSet.add(opts.getConfig().additionalProperties().get(GeneratorExternalConfigConstant.MODEL_PROJECT_NAME));\n      this.opts(opts);\n      fileList.addAll(super.generate());\n    }\n\n    moduleSet.forEach(module -> {\n      modules.add(Collections.singletonMap(\"module\", module));\n    });\n\n    if (ServiceType.ALL.getValue().equals(\n        Optional.ofNullable(opts.getConfig().additionalProperties().get(ProjectMetaConstant.SERVICE_TYPE))\n            .orElse(ServiceType.ALL.getValue()))) {\n      generateParentProject(fileList, modules);\n    }\n\n    return fileList;\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/ProjectMetaConstant.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\npublic class ProjectMetaConstant {\n\n  public static final String SERVICE_TYPE = \"serviceType\";\n\n  public static final String PROVIDER_SERVICE_ID = \"providerServiceId\";\n\n  public static final String SERVICE_ID = \"serviceId\";\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/ProviderDirectoryStrategy.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.util.List;\n\nimport org.openapitools.codegen.SupportingFile;\n\npublic class ProviderDirectoryStrategy extends AbstractProviderDirectoryStrategy {\n\n  protected String providerTemplateFolder = \"provider\";\n\n  @Override\n  public String modelDirectory() {\n    return providerDirectory();\n  }\n\n  @Override\n  public String providerDirectory() {\n    return (String) propertiesMap.get(\"artifactId\");\n  }\n\n  @Override\n  public String consumerDirectory() {\n    throw new UnsupportedOperationException();\n  }\n\n  @Override\n  public void processSupportingFile(List<SupportingFile> supportingFiles) {\n    super.processSupportingFile(supportingFiles);\n    supportingFiles.add(new SupportingFile(\"pom.mustache\",\n        providerDirectory(),\n        \"pom.xml\")\n    );\n\n    supportingFiles.add(new SupportingFile(\"Application.mustache\",\n        mainClassFolder(providerDirectory()),\n        \"Application.java\")\n    );\n\n    supportingFiles.add(new SupportingFile(\"log4j2.mustache\",\n        resourcesFolder(providerDirectory()),\n        \"log4j2.xml\")\n    );\n\n    supportingFiles.add(new SupportingFile(providerTemplateFolder + \"/microservice.mustache\",\n        resourcesFolder(providerDirectory()),\n        \"microservice.yaml\")\n    );\n\n    propertiesMap\n        .computeIfAbsent(GeneratorExternalConfigConstant.PROVIDER_ARTIFACT_ID, k -> propertiesMap.get(\"artifactId\"));\n    propertiesMap\n        .put(GeneratorExternalConfigConstant.PROVIDER_PROJECT_NAME, providerDirectory());\n\n    if (ServiceCombCodegen.POJO_LIBRARY.equals(propertiesMap.get(\"library\"))) {\n//      ((Map<String, String>) propertiesMap.get(\"apiTemplateFiles\")).put(pojoApiImplTemplate, \".java\");\n      propertiesMap.put(\"isPOJO\", true);\n    }\n    propertiesMap.put(\"isMultipleModule\", false);\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/ServiceCombCodegen.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport static org.openapitools.codegen.utils.StringUtils.camelize;\n\nimport java.io.File;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\n\nimport org.openapitools.codegen.CliOption;\nimport org.openapitools.codegen.CodegenConstants;\nimport org.openapitools.codegen.CodegenModel;\nimport org.openapitools.codegen.CodegenProperty;\nimport org.openapitools.codegen.CodegenType;\nimport org.openapitools.codegen.languages.SpringCodegen;\n\nimport io.swagger.codegen.mustache.CamelCaseLambda;\n\npublic class ServiceCombCodegen extends AbstractJavaCodegenExt {\n\n  public static final String DEFAULT_LIBRARY = \"SpringMVC\";\n\n  public static final String POJO_LIBRARY = \"POJO\";\n\n  public static final String JAX_RS_LIBRARY = \"JAX-RS\";\n\n  public static final String SPRING_BOOT_LIBRARY = \"SpringBoot\";\n\n  private String applicationId = \"defaultApp\";\n\n  private String serviceId = \"defaultService\";\n\n  private String modelTemplateFolder = \"model\";\n\n  @Override\n  public CodegenType getTag() {\n    return CodegenType.SERVER;\n  }\n\n  @Override\n  public String getName() {\n    return \"ServiceComb\";\n  }\n\n  @Override\n  public String getHelp() {\n    return \"Generates a ServiceComb server library.\";\n  }\n\n  public ServiceCombCodegen() {\n    super();\n\n    outputFolder = \"generated-code/ServiceComb\";\n\n    embeddedTemplateDir = templateDir = \"ServiceComb\";\n    modelTemplateFiles.put(modelTemplateFolder + \"/model.mustache\", \".java\");\n    modelTemplateFiles.remove(\"model.mustache\");\n\n    supportedLibraries.put(DEFAULT_LIBRARY, \"ServiceComb Server application using the SpringMVC programming model.\");\n    supportedLibraries.put(POJO_LIBRARY, \"ServiceComb Server application using the POJO programming model.\");\n    supportedLibraries.put(JAX_RS_LIBRARY, \"ServiceComb Server application using the JAX-RS programming model.\");\n    supportedLibraries\n        .put(SPRING_BOOT_LIBRARY, \"ServiceComb Server application using the SpringBoot programming model.\");\n\n    setLibrary(DEFAULT_LIBRARY);\n\n    CliOption library = new CliOption(CodegenConstants.LIBRARY, \"library template (sub-template) to use\");\n    library.setEnum(supportedLibraries);\n    library.setDefault(DEFAULT_LIBRARY);\n    cliOptions.add(library);\n\n    addDirectoryStrategy(new ProviderDirectoryStrategy(), ServiceType.PROVIDER.getValue());\n    addDirectoryStrategy(new ConsumerDirectoryStrategy(), ServiceType.CONSUMER.getValue());\n    addDirectoryStrategy(new DefaultDirectoryStrategy(), ServiceType.ALL.getValue());\n  }\n\n  @Override\n  public String modelFileFolder() {\n    return outputFolder + \"/\" + currentDirectoryStrategy.modelDirectory() + \"/\" + sourceFolder + \"/\" + modelPackage()\n        .replace('.', '/');\n  }\n\n  @Override\n  public String apiFileFolder() {\n    return outputFolder + \"/\" + currentDirectoryStrategy.providerDirectory() + \"/\" + sourceFolder + \"/\" + apiPackage()\n        .replace('.', '/');\n  }\n\n  @Override\n  public String apiFilename(String templateName, String tag) {\n    if (ServiceType.CONSUMER.getValue().equals(additionalProperties.get(ProjectMetaConstant.SERVICE_TYPE))\n        || ServiceType.CONSUMER.getValue().equals(additionalProperties.get(templateName))) {\n      String suffix = apiTemplateFiles().get(templateName);\n      return apiConsumerFolder() + File.separator + toApiFilename(tag) + suffix;\n    }\n\n    return super.apiFilename(templateName, tag);\n  }\n\n  private String apiConsumerFolder() {\n    return outputFolder + \"/\" + currentDirectoryStrategy.consumerDirectory() + \"/\" + sourceFolder + \"/\" + apiPackage()\n        .replace('.', '/');\n  }\n\n  @Override\n  public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<Object> allModels) {\n\n    Map operations = (Map) objs.get(\"operations\");\n    String classnameImpl = operations.get(\"classname\") + \"Impl\";\n    operations.put(\"classnameImpl\", classnameImpl);\n    additionalProperties.put(\"classnameImpl\", classnameImpl);\n    return super.postProcessOperationsWithModels(objs, allModels);\n  }\n\n  @Override\n  public void processOpts() {\n\n    super.processOpts();\n\n    importMapping.put(\"OffsetDateTime\", \"java.time.OffsetDateTime\");\n    additionalProperties.put(\"dateLibrary\", \"java8\");\n    additionalProperties.put(\"camelcase\", new CamelCaseLambda());\n    additionalProperties.put(\"getGenericClassType\", new GetGenericClassTypeLambda());\n    additionalProperties.put(\"getRelativeBasePath\", new GetRelativeBasePathLambda());\n    additionalProperties.put(\"applicationId\", applicationId);\n    additionalProperties.put(\"library\", getLibrary());\n    additionalProperties.put(\"outputFolder\", outputFolder);\n    additionalProperties.put(\"apiTemplateFiles\", apiTemplateFiles);\n    additionalProperties.put(\"apiTestTemplateFiles\", apiTestTemplateFiles);\n    additionalProperties.put(\"modelTemplateFiles\", modelTemplateFiles);\n    additionalProperties.put(\"apiDocTemplateFiles\", apiDocTemplateFiles);\n\n    if (additionalProperties.get(ProjectMetaConstant.SERVICE_ID) != null) {\n      serviceId = (String) additionalProperties.get(ProjectMetaConstant.SERVICE_ID);\n    }\n    additionalProperties.put(ProjectMetaConstant.SERVICE_ID, serviceId);\n\n    currentDirectoryStrategy = getStrategyMap()\n        .get(Optional.ofNullable(additionalProperties.get(ProjectMetaConstant.SERVICE_TYPE))\n            .orElse(ServiceType.ALL.getValue()));\n\n    // when all additionalProperties are processed\n    currentDirectoryStrategy.addCustomProperties(additionalProperties);\n    currentDirectoryStrategy.processSupportingFile(supportingFiles);\n  }\n\n  @Override\n  public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {\n    super.postProcessModelProperty(model, property);\n    model.imports.remove(\"ApiModelProperty\");\n    model.imports.remove(\"ApiModel\");\n  }\n\n  @Override\n  public Map<String, Object> postProcessModelsEnum(Map<String, Object> objs) {\n    objs = super.postProcessModelsEnum(objs);\n    SpringCodegen springCodegen = new SpringCodegen();\n    return springCodegen.postProcessModelsEnum(objs);\n  }\n\n  @Override\n  public String toApiName(String name) {\n    if (name.length() == 0) {\n      return \"DefaultApi\";\n    }\n\n    String apiName = (String) additionalProperties.get(\"apiName\");\n    if (apiName != null) {\n      return apiName;\n    }\n\n    return camelize(name) + \"Api\";\n  }\n}"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/ServiceType.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\npublic enum ServiceType {\n\n  /**\n   * both consumer and provider\n   */\n  ALL,\n\n  /**\n   *  only consumer project\n   */\n  CONSUMER,\n\n  /**\n   *  only provider project\n   */\n  PROVIDER;\n\n  public String getValue() {\n    return toString().toLowerCase();\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/ShowBasePathLambda.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.io.IOException;\nimport java.io.Writer;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\nimport com.samskivert.mustache.Mustache;\nimport com.samskivert.mustache.Template.Fragment;\n\npublic class ShowBasePathLambda implements Mustache.Lambda {\n  \n  private Pattern pattern = Pattern.compile(\"\\\"[ ]*[/]*[ ]*\\\"\");\n\n  @Override\n  public void execute(Fragment fragment, Writer writer) throws IOException {\n\n    String text = fragment.execute();\n    Matcher matcher = pattern.matcher(text);\n\n    if (matcher.find()) {\n      return;\n    }\n    writer.write(text);\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/SpringCloudCodegen.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport static org.openapitools.codegen.utils.StringUtils.camelize;\n\nimport java.io.File;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.openapitools.codegen.CodegenType;\nimport org.openapitools.codegen.templating.mustache.CamelCaseLambda;\n\npublic class SpringCloudCodegen extends AbstractJavaCodegenExt {\n\n  private String applicationId = \"defaultApp\";\n\n  private String serviceId = \"defaultService\";\n\n  private String consumerTemplateFolder = \"consumer/openfeign\";\n\n  private String providerTemplateFolder = \"provider/servlet\";\n\n  private String modelTemplateFolder = \"model\";\n\n  private String apiConsumerTemplate = consumerTemplateFolder + \"/apiConsumer.mustache\";\n\n  public SpringCloudCodegen() {\n\n    super();\n    outputFolder = \"generated-code/SpringCloud\";\n    apiTemplateFiles.remove(\"api.mustache\");\n    apiTemplateFiles.put(providerTemplateFolder + \"/api.mustache\", \".java\");\n    embeddedTemplateDir = templateDir = \"SpringCloud\";\n    modelTemplateFiles.put(modelTemplateFolder + \"/model.mustache\", \".java\");\n    modelTemplateFiles.remove(\"model.mustache\");\n\n    addDirectoryStrategy(new SpringCloudProviderDirectoryStrategy(), ServiceType.PROVIDER.getValue());\n    addDirectoryStrategy(new SpringCloudConsumerDirectoryStrategy(), ServiceType.CONSUMER.getValue());\n    addDirectoryStrategy(new SpringCloudMultiDirectoryStrategy(), ServiceType.ALL.getValue());\n  }\n\n  @Override\n  public void processOpts() {\n\n    super.processOpts();\n\n    importMapping.put(\"OffsetDateTime\", \"java.time.OffsetDateTime\");\n    additionalProperties.put(\"dateLibrary\", \"java8\");\n    additionalProperties.put(\"camelcase\", new CamelCaseLambda());\n    additionalProperties.put(\"apiTemplateFiles\", apiTemplateFiles);\n    additionalProperties.put(\"getGenericClassType\", new GetGenericClassTypeLambda());\n    additionalProperties.put(\"getRelativeBasePath\", new GetRelativeBasePathLambda());\n    additionalProperties.put(\"showBasePath\", new ShowBasePathLambda());\n    additionalProperties.put(\"applicationId\", applicationId);\n\n    if (additionalProperties.get(ProjectMetaConstant.SERVICE_ID) != null) {\n      serviceId = (String) additionalProperties.get(ProjectMetaConstant.SERVICE_ID);\n    }\n    additionalProperties.put(ProjectMetaConstant.SERVICE_ID, serviceId);\n\n    currentDirectoryStrategy = getStrategyMap()\n        .get(Optional.ofNullable(additionalProperties.get(ProjectMetaConstant.SERVICE_TYPE))\n            .orElse(ServiceType.ALL.getValue()));\n\n    // when all additionalProperties are processed\n    currentDirectoryStrategy.addCustomProperties(additionalProperties);\n    currentDirectoryStrategy.processSupportingFile(supportingFiles);\n  }\n\n  @Override\n  public String toApiName(String name) {\n    if (name.length() == 0) {\n      return \"DefaultApi\";\n    }\n\n    String apiName = (String) additionalProperties.get(\"apiName\");\n    if (apiName != null) {\n      return apiName;\n    }\n\n    return camelize(name) + \"Api\";\n  }\n\n  @Override\n  public String apiFileFolder() {\n    return outputFolder + \"/\" + currentDirectoryStrategy.providerDirectory() + \"/\" + sourceFolder + \"/\" + apiPackage()\n        .replace('.', '/');\n  }\n\n  @Override\n  public String apiFilename(String templateName, String tag) {\n    if (ServiceType.CONSUMER.getValue().equals(additionalProperties.get(ProjectMetaConstant.SERVICE_TYPE))\n        || ServiceType.CONSUMER.getValue().equals(additionalProperties.get(templateName))) {\n      String suffix = apiTemplateFiles().get(templateName);\n      return apiConsumerFolder() + File.separator + toApiFilename(tag) + suffix;\n    }\n\n    return super.apiFilename(templateName, tag);\n  }\n\n  private String apiConsumerFolder() {\n    return outputFolder + \"/\" + currentDirectoryStrategy.consumerDirectory() + \"/\" + sourceFolder + \"/\" + apiPackage()\n        .replace('.', '/');\n  }\n\n  @Override\n  public String modelFileFolder() {\n    return outputFolder + \"/\" + currentDirectoryStrategy.modelDirectory() + \"/\" + sourceFolder + \"/\" + modelPackage()\n        .replace('.', '/');\n  }\n\n  @Override\n  public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs,\n      List<Object> allModels) {\n\n    Map operations = (Map) objs.get(\"operations\");\n    String classnameImpl = (String) operations.get(\"classname\") + \"Impl\";\n    operations.put(\"classnameImpl\", classnameImpl);\n    additionalProperties.put(\"classnameImpl\", classnameImpl);\n    return super.postProcessOperationsWithModels(objs, allModels);\n  }\n\n  @Override\n  public CodegenType getTag() {\n    return CodegenType.SERVER;\n  }\n\n  @Override\n  public String getName() {\n    return \"SpringCloud\";\n  }\n\n  @Override\n  public String getHelp() {\n    return \"Generates a SpringCloud server library.\";\n  }\n}"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/SpringCloudConsumerDirectoryStrategy.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.openapitools.codegen.SupportingFile;\n\npublic class SpringCloudConsumerDirectoryStrategy extends AbstractConsumerDirectoryStrategy {\n\n  private String consumerTemplateFolder = \"consumer/openfeign\";\n\n  private String apiConsumerTemplate = consumerTemplateFolder + \"/apiConsumer.mustache\";\n\n  @Override\n  public String modelDirectory() {\n    return consumerDirectory();\n  }\n\n  @Override\n  public String providerDirectory() {\n    throw new UnsupportedOperationException();\n  }\n\n  @Override\n  public String consumerDirectory() {\n    return (String) propertiesMap.get(\"artifactId\");\n  }\n\n  @Override\n  public void processSupportingFile(List<SupportingFile> supportingFiles) {\n\n    super.processSupportingFile(supportingFiles);\n\n    supportingFiles.add(new SupportingFile(consumerTemplateFolder + \"/applicationYml.mustache\",\n        resourcesFolder(consumerDirectory()),\n        \"application.yml\"));\n\n    supportingFiles.add(new SupportingFile(consumerTemplateFolder + \"/pom.mustache\",\n        consumerDirectory(),\n        \"pom.xml\")\n    );\n\n    supportingFiles.add(new SupportingFile(consumerTemplateFolder + \"/Application.mustache\",\n        mainClassFolder(consumerDirectory()),\n        \"Application.java\")\n    );\n\n    propertiesMap.computeIfAbsent(GeneratorExternalConfigConstant.CONSUMER_ARTIFACT_ID,\n        k -> consumerDirectory());\n\n    propertiesMap\n        .put(GeneratorExternalConfigConstant.CONSUMER_PROJECT_NAME, consumerDirectory());\n\n    propertiesMap.put(apiConsumerTemplate, ServiceType.CONSUMER.getValue());\n\n    Map<String, String> apiTemplateFiles = ((Map<String, String>) propertiesMap.get(\"apiTemplateFiles\"));\n    apiTemplateFiles.remove(\"api.mustache\");\n    apiTemplateFiles.put(apiConsumerTemplate, \".java\");\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/SpringCloudMultiDirectoryStrategy.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\n\nimport org.openapitools.codegen.SupportingFile;\n\npublic class SpringCloudMultiDirectoryStrategy extends AbstractMultiDirectoryStrategy {\n\n  private String consumerTemplateFolder = \"consumer/openfeign\";\n\n  private String providerTemplateFolder = \"provider/servlet\";\n\n  private String apiConsumerTemplate = consumerTemplateFolder + \"/apiConsumer.mustache\";\n\n  @Override\n  public String modelDirectory() {\n    return Optional.ofNullable((String) propertiesMap.get(GeneratorExternalConfigConstant.MODEL_PROJECT_NAME))\n        .orElse(\"model\");\n  }\n\n  @Override\n  public String providerDirectory() {\n    return Optional.ofNullable((String) propertiesMap.get(GeneratorExternalConfigConstant.PROVIDER_PROJECT_NAME))\n        .orElse(\"provider\");\n  }\n\n  @Override\n  public String consumerDirectory() {\n    return Optional.ofNullable((String) propertiesMap.get(GeneratorExternalConfigConstant.CONSUMER_PROJECT_NAME))\n        .orElse(\"consumer\");\n  }\n\n  @Override\n  public void processSupportingFile(List<SupportingFile> supportingFiles) {\n    super.processSupportingFile(supportingFiles);\n    processProvider(supportingFiles);\n    processConsumer(supportingFiles);\n    processModel(supportingFiles);\n    propertiesMap.put(\"isMultipleModule\", true);\n\n    supportingFiles.add(new SupportingFile(\"project/pom.mustache\",\n        \"\",\n        \"pom.xml\")\n    );\n  }\n\n\n  private void processModel(List<SupportingFile> supportingFiles) {\n\n    propertiesMap\n        .computeIfAbsent(GeneratorExternalConfigConstant.MODEL_ARTIFACT_ID, k -> modelDirectory());\n    propertiesMap.put(GeneratorExternalConfigConstant.MODEL_PROJECT_NAME, modelDirectory());\n\n    supportingFiles.add(new SupportingFile(\"model/pom.mustache\",\n        modelDirectory(),\n        \"pom.xml\")\n    );\n  }\n\n  private void processProvider(List<SupportingFile> supportingFiles) {\n\n    supportingFiles.add(new SupportingFile(providerTemplateFolder + \"/applicationYml.mustache\",\n        resourcesFolder(providerDirectory()),\n        \"application.yml\"));\n\n    supportingFiles.add(new SupportingFile(providerTemplateFolder + \"/pom.mustache\",\n        providerDirectory(),\n        \"pom.xml\")\n    );\n\n    supportingFiles.add(new SupportingFile(providerTemplateFolder + \"/Application.mustache\",\n        mainClassFolder(providerDirectory()),\n        \"Application.java\")\n    );\n\n    propertiesMap.computeIfAbsent(GeneratorExternalConfigConstant.PROVIDER_ARTIFACT_ID,\n        k -> providerDirectory());\n    propertiesMap\n        .put(GeneratorExternalConfigConstant.PROVIDER_PROJECT_NAME, providerDirectory());\n  }\n\n  private void processConsumer(List<SupportingFile> supportingFiles) {\n\n    supportingFiles.add(new SupportingFile(consumerTemplateFolder + \"/applicationYml.mustache\",\n        resourcesFolder(consumerDirectory()),\n        \"application.yml\"));\n\n    supportingFiles.add(new SupportingFile(consumerTemplateFolder + \"/pom.mustache\",\n        consumerDirectory(),\n        \"pom.xml\")\n    );\n\n    supportingFiles.add(new SupportingFile(consumerTemplateFolder + \"/Application.mustache\",\n        mainClassFolder(consumerDirectory()),\n        \"Application.java\")\n    );\n\n    propertiesMap.computeIfAbsent(GeneratorExternalConfigConstant.CONSUMER_ARTIFACT_ID,\n        k -> consumerDirectory());\n\n    propertiesMap\n        .put(GeneratorExternalConfigConstant.CONSUMER_PROJECT_NAME, consumerDirectory());\n\n    propertiesMap.put(apiConsumerTemplate, ServiceType.CONSUMER.getValue());\n\n    Map<String, String> apiTemplateFiles = ((Map<String, String>) propertiesMap.get(\"apiTemplateFiles\"));\n    apiTemplateFiles.put(apiConsumerTemplate, \".java\");\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/java/org/apache/servicecomb/toolkit/codegen/SpringCloudProviderDirectoryStrategy.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.util.List;\n\nimport org.openapitools.codegen.SupportingFile;\n\npublic class SpringCloudProviderDirectoryStrategy extends AbstractProviderDirectoryStrategy {\n\n  private String providerTemplateFolder = \"provider/servlet\";\n\n  @Override\n  public String modelDirectory() {\n    return providerDirectory();\n  }\n\n  @Override\n  public String providerDirectory() {\n    return (String) propertiesMap.get(\"artifactId\");\n  }\n\n  @Override\n  public String consumerDirectory() {\n    throw new UnsupportedOperationException();\n  }\n\n  @Override\n  public void processSupportingFile(List<SupportingFile> supportingFiles) {\n\n    super.processSupportingFile(supportingFiles);\n    supportingFiles.add(new SupportingFile(providerTemplateFolder + \"/applicationYml.mustache\",\n        resourcesFolder(providerDirectory()),\n        \"application.yml\"));\n\n    supportingFiles.add(new SupportingFile(providerTemplateFolder + \"/pom.mustache\",\n        providerDirectory(),\n        \"pom.xml\")\n    );\n\n    supportingFiles.add(new SupportingFile(providerTemplateFolder + \"/Application.mustache\",\n        mainClassFolder(providerDirectory()),\n        \"Application.java\")\n    );\n\n    propertiesMap.computeIfAbsent(GeneratorExternalConfigConstant.PROVIDER_ARTIFACT_ID,\n        k -> providerDirectory());\n    propertiesMap\n        .put(GeneratorExternalConfigConstant.PROVIDER_PROJECT_NAME, providerDirectory());\n  }\n}\n"
  },
  {
    "path": "codegen/src/main/resources/META-INF/services/org.apache.servicecomb.toolkit.CodeGenerator",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\norg.apache.servicecomb.toolkit.codegen.DefaultCodeGenerator"
  },
  {
    "path": "codegen/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\norg.apache.servicecomb.toolkit.codegen.ServiceCombCodegen\norg.apache.servicecomb.toolkit.codegen.SpringCloudCodegen"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/consumer/Application.mustache",
    "content": "package {{mainClassPackage}};\n\nimport org.apache.servicecomb.foundation.common.utils.BeanUtils;\n\npublic class Application {\n\n  public static void main(String[] args) throws Exception {\n    BeanUtils.init();\n  }\n}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/consumer/apiConsumer.mustache",
    "content": "package {{apiPackage}};\n\nimport static org.springframework.http.MediaType.*;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.HashMap;\n{{#imports}}import {{import}};\n{{/imports}}\nimport org.apache.servicecomb.provider.rest.common.RestSchema;\nimport org.apache.servicecomb.provider.springmvc.reference.RestTemplateBuilder;\nimport org.springframework.util.MultiValueMap;\nimport org.springframework.http.*;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestHeader;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.RequestPart;\nimport org.springframework.web.client.RestTemplate;\nimport org.springframework.web.multipart.MultipartFile;\n\n{{#operations}}\npublic class {{classname}} {\n{{#operation}}\n\n  public ResponseEntity<{{>returnTypes}}> {{operationId}}({{#allParams}}{{>consumer/queryParamsConsumer}}{{>consumer/pathParamsConsumer}}{{>consumer/headerParamsConsumer}}{{>consumer/bodyParamsConsumer}}{{>consumer/formParamsConsumer}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {\n\n    Map<String, Object> params = new HashMap<>();\n    HttpEntity httpEntity = null;\n    HttpHeaders headers = new HttpHeaders();\n    {{#allParams}}\n    {{#isPathParam}}\n    params.put(\"{{paramName}}\",{{paramName}});\n    {{/isPathParam}}\n    {{#isQueryParam}}\n    params.put(\"{{paramName}}\",{{paramName}});\n    {{/isQueryParam}}\n    {{#isHeaderParam}}\n    headers.add(\"{{paramName}}\",{{paramName}});\n    {{/isHeaderParam}}\n    {{#isFormParam}}\n    {{^isFile}}\n    httpEntity =  new HttpEntity<{{{dataType}}}>({{paramName}}, headers);\n    {{/isFile}}\n    {{#isFile}}\n    httpEntity =  new HttpEntity<MultipartFile>({{paramName}}, headers);\n    {{/isFile}}\n    {{/isFormParam}}\n    {{#isBodyParam}}\n    httpEntity =  new HttpEntity<{{{dataType}}}>({{paramName}}, headers);\n    {{/isBodyParam}}\n    {{/allParams}}\n\n    RestTemplate restTemplate = RestTemplateBuilder.create();\n\n    ResponseEntity<{{>returnTypes}}> result = restTemplate.exchange(\"cse://{{providerServiceId}}{{#getRelativeBasePath}}{{basePath}}{{/getRelativeBasePath}}{{path}}\",HttpMethod.{{httpMethod}},httpEntity,{{#getGenericClassType}}{{>returnTypes}}{{/getGenericClassType}}.class,params);\n\n    // do something\n\n    return result;\n  }\n{{/operation}}\n}\n{{/operations}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/consumer/bodyParamsConsumer.mustache",
    "content": "{{#isBodyParam}} {{{dataType}}} {{paramName}}{{/isBodyParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/consumer/formParamsConsumer.mustache",
    "content": "{{#isFormParam}}{{^isFile}}{{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}} {{#isPOJO}}File{{/isPOJO}}{{^isPOJO}}MultipartFile{{/isPOJO}} {{baseName}}{{/isFile}}{{/isFormParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/consumer/headerParamsConsumer.mustache",
    "content": "{{#isHeaderParam}} {{{dataType}}} {{paramName}}{{/isHeaderParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/consumer/microservice.mustache",
    "content": "#Indicates an application name\nAPPLICATION_ID: {{applicationId}}\nservice_description:\n#Indicates a microservice name\n#The microservice name should be unique within an application.\n#The name can contain digits, uppercase and lowercase letters, hyphens(-), underscores(_), and periods(.); and can neither start nor end with punctuations.\n#The naming rule is as follows: ^[a-zA-Z0-9]+$|^[a-zA-Z0-9][a-zA-Z0-9_-.]*[a-zA-Z0-9]$.\n  name: {{consumerServiceId}}\n#Indicates a service version\n  version: 1.0.0\nservicecomb:\n  service:\n  #Specifies the service center IP address.\n    registry:\n      address: http://127.0.0.1:30100"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/consumer/pathParamsConsumer.mustache",
    "content": "{{#isPathParam}} {{{dataType}}} {{paramName}}{{/isPathParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/consumer/pojo/apiConsumer.mustache",
    "content": "package {{apiPackage}};\n\nimport java.util.List;\n{{#imports}}import {{import}};\n{{/imports}}\nimport org.apache.servicecomb.provider.pojo.RpcReference;\nimport org.springframework.stereotype.Component;\n\n{{#operations}}\n@Component\npublic class {{classname}}Consumer{\n\n  @RpcReference(microserviceName = \"{{providerServiceId}}\", schemaId = \"{{#camelcase}}{{classname}}{{/camelcase}}\")\n  private {{classname}} api;\n\n{{#operation}}\n\n  public {{>returnTypes}} {{operationId}}({{#allParams}}{{>consumer/queryParamsConsumer}}{{>consumer/pathParamsConsumer}}{{>consumer/headerParamsConsumer}}{{>consumer/bodyParamsConsumer}}{{>consumer/formParamsConsumer}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {\n\n    return api.{{operationId}}({{#allParams}}{{#isQueryParam}}{{paramName}}{{/isQueryParam}}{{#isPathParam}}{{paramName}}{{/isPathParam}}{{#isHeaderParam}}{{paramName}}{{/isHeaderParam}}{{#isBodyParam}}{{paramName}}{{/isBodyParam}}{{#isFormParam}}{{paramName}}{{/isFormParam}}{{#hasMore}}, {{/hasMore}}{{/allParams}});\n  }\n{{/operation}}\n}\n{{/operations}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/consumer/pojo/apiInterface.mustache",
    "content": "package {{apiPackage}};\n\nimport java.util.List;\nimport java.util.Map;\nimport java.util.HashMap;\nimport java.io.File;\n{{#imports}}import {{import}};\n{{/imports}}\n{{#operations}}\npublic interface {{classname}} {\n {{#operation}}\n\n  public {{>returnTypes}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}});\n {{/operation}}\n}\n{{/operations}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/consumer/pom.mustache",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\n  {{#isMultipleModule}}\n    <parent>\n      <artifactId>{{artifactId}}</artifactId>\n      <groupId>{{groupId}}</groupId>\n      <version>{{artifactVersion}}</version>\n    </parent>\n  {{/isMultipleModule}}\n\n  <modelVersion>4.0.0</modelVersion>\n  <artifactId>{{consumerArtifactId}}</artifactId>\n  <packaging>jar</packaging>\n{{^isMultipleModule}}\n  <groupId>{{groupId}}</groupId>\n  <version>{{artifactVersion}}</version>\n{{/isMultipleModule}}\n  <name>{{consumerArtifactId}}</name>\n\n  <properties>\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <java-chassis.version>1.2.0</java-chassis.version>\n  </properties>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.apache.servicecomb</groupId>\n        <artifactId>java-chassis-dependencies</artifactId>\n        <version>${java-chassis.version}</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n  <dependencies>\n{{#isMultipleModule}}\n      <dependency>\n        <groupId>{{groupId}}</groupId>\n        <artifactId>{{modelArtifactId}}</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n{{/isMultipleModule}}\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-bizkeeper</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-loadbalance</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>transport-highway</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>transport-rest-vertx</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-flowcontrol-qps</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>provider-pojo</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>provider-springmvc</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-slf4j-impl</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-api</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-core</artifactId>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n        <version>3.1</version>\n        <configuration>\n          <source>1.8</source>\n          <target>1.8</target>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-resources-plugin</artifactId>\n        <version>3.0.0</version>\n        <configuration>\n          <encoding>UTF-8</encoding>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-maven-plugin</artifactId>\n        <version>1.5.12.RELEASE</version>\n        <configuration>\n          <fork>true</fork>\n          <mainClass>{{mainClassPackage}}.Application</mainClass>\n          <outputDirectory>target/bin</outputDirectory>\n        </configuration>\n        <executions>\n          <execution>\n            <goals>\n              <goal>repackage</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/consumer/queryParamsConsumer.mustache",
    "content": "{{#isQueryParam}}{{{dataType}}} {{paramName}}{{/isQueryParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/consumer/springboot/Application.mustache",
    "content": "package {{mainClassPackage}};\n\nimport org.apache.servicecomb.springboot.starter.provider.EnableServiceComb;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\n@EnableServiceComb\npublic class Application {\n\n  public static void main(String[] args) throws Exception {\n    SpringApplication.run(Application.class, args);\n  }\n}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/consumer/springboot/pom.mustache",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\n{{#isMultipleModule}}\n  <parent>\n    <artifactId>{{artifactId}}</artifactId>\n    <groupId>{{groupId}}</groupId>\n    <version>{{artifactVersion}}</version>\n  </parent>\n{{/isMultipleModule}}\n\n  <modelVersion>4.0.0</modelVersion>\n  <artifactId>{{consumerArtifactId}}</artifactId>\n  <packaging>jar</packaging>\n{{^isMultipleModule}}\n  <groupId>{{groupId}}</groupId>\n  <version>{{artifactVersion}}</version>\n{{/isMultipleModule}}\n  <name>{{consumerArtifactId}}</name>\n\n  <properties>\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <java-chassis.version>1.2.0</java-chassis.version>\n  </properties>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.apache.servicecomb</groupId>\n        <artifactId>java-chassis-dependencies</artifactId>\n        <version>${java-chassis.version}</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n  <dependencies>\n  {{#isMultipleModule}}\n    <dependency>\n      <groupId>{{groupId}}</groupId>\n      <artifactId>{{modelArtifactId}}</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n  {{/isMultipleModule}}\n\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>spring-boot-starter-provider</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>spring-boot-starter-provider</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-flowcontrol-qps</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-bizkeeper</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-tracing-zipkin</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>inspector</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.hibernate.validator</groupId>\n      <artifactId>hibernate-validator</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>javax.validation</groupId>\n      <artifactId>validation-api</artifactId>\n      <version>2.0.1.Final</version>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n        <version>3.1</version>\n        <configuration>\n          <source>1.8</source>\n          <target>1.8</target>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-resources-plugin</artifactId>\n        <version>3.0.0</version>\n        <configuration>\n          <encoding>UTF-8</encoding>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-maven-plugin</artifactId>\n        <version>1.5.12.RELEASE</version>\n        <configuration>\n          <fork>true</fork>\n          <mainClass>{{mainClassPackage}}.Application</mainClass>\n          <outputDirectory>target/bin</outputDirectory>\n        </configuration>\n        <executions>\n          <execution>\n            <goals>\n              <goal>repackage</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/enumClass.mustache",
    "content": "public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {\n{{#gson}}\n  {{#allowableValues}}\n  {{#enumVars}}\n  @SerializedName({{#isInteger}}\"{{/isInteger}}{{#isDouble}}\"{{/isDouble}}{{#isLong}}\"{{/isLong}}{{#isFloat}}\"{{/isFloat}}{{{value}}}{{#isInteger}}\"{{/isInteger}}{{#isDouble}}\"{{/isDouble}}{{#isLong}}\"{{/isLong}}{{#isFloat}}\"{{/isFloat}})\n  {{{name}}}({{{value}}}){{^-last}},\n  {{/-last}}{{#-last}};{{/-last}}\n  {{/enumVars}}\n  {{/allowableValues}}\n{{/gson}}\n{{^gson}}\n  {{#allowableValues}}\n  {{#enumVars}}\n  {{{name}}}({{{value}}}){{^-last}},\n  {{/-last}}{{#-last}};{{/-last}}\n  {{/enumVars}}\n  {{/allowableValues}}\n{{/gson}}\n\n  private {{{datatype}}} value;\n\n  {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{datatype}}} value) {\n    this.value = value;\n  }\n\n  @Override\n  public String toString() {\n    return String.valueOf(value);\n  }\n\n  public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) {\n    for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {\n      if (String.valueOf(b.value).equals(text)) {\n        return b;\n      }\n    }\n\n    return null;\n  }\n}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/enumOuterClass.mustache",
    "content": "public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {\n{{#gson}}\n  {{#allowableValues}}{{#enumVars}}\n  @SerializedName({{#isInteger}}\"{{/isInteger}}{{#isDouble}}\"{{/isDouble}}{{#isLong}}\"{{/isLong}}{{#isFloat}}\"{{/isFloat}}{{{value}}}{{#isInteger}}\"{{/isInteger}}{{#isDouble}}\"{{/isDouble}}{{#isLong}}\"{{/isLong}}{{#isFloat}}\"{{/isFloat}})\n  {{{name}}}({{{value}}}){{^-last}},\n  {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}}\n{{/gson}}\n{{^gson}}\n  {{#allowableValues}}{{#enumVars}}\n  {{{name}}}({{{value}}}){{^-last}},\n  {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}}\n{{/gson}}\n\n  private {{{dataType}}} value;\n\n  {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) {\n    this.value = value;\n  }\n\n  @Override\n  public String toString() {\n    return String.valueOf(value);\n  }\n\n  public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) {\n    for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {\n      if (String.valueOf(b.value).equals(text)) {\n        return b;\n      }\n    }\n\n    return null;\n  }\n}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/JAX-RS/Application.mustache",
    "content": "package {{mainClassPackage}};\n\nimport org.apache.servicecomb.foundation.common.utils.BeanUtils;\n\npublic class Application {\n\n  public static void main(String[] args) throws Exception {\n    BeanUtils.init();\n  }\n}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/JAX-RS/api.mustache",
    "content": "package {{apiPackage}};\n\nimport java.util.Map;\nimport java.util.List;\nimport java.io.InputStream;\nimport javax.servlet.ServletConfig;\nimport javax.servlet.http.Part;\nimport javax.ws.rs.core.Context;\nimport javax.ws.rs.core.Response;\nimport javax.ws.rs.core.SecurityContext;\nimport javax.ws.rs.*;\n{{#imports}}import {{import}};\n{{/imports}}\nimport org.apache.servicecomb.provider.rest.common.RestSchema;\nimport io.swagger.annotations.ApiParam;\n\n{{#hasConsumes}}@Consumes({ {{#consumes}}\"{{{mediaType}}}\"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}\n{{#hasProduces}}@Produces({ {{#produces}}\"{{{mediaType}}}\"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}\n{{#operations}}\n@RestSchema(schemaId = \"{{#camelcase}}{{classname}}{{/camelcase}}\")\n@Path(\"{{#getRelativeBasePath}}{{basePath}}{{/getRelativeBasePath}}\")\npublic class {{classname}} {\n{{#operation}}\n\n  {{#hasConsumes}}@Consumes({ {{#consumes}}\"{{{mediaType}}}\"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}\n  {{#hasProduces}}@Produces({ {{#produces}}\"{{{mediaType}}}\"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}\n  @Path(\"{{{path}}}\")\n  @{{httpMethod}}\n  public {{>returnTypes}} {{nickname}}({{#allParams}}{{>libraries/JAX-RS/queryParams}}{{>libraries/JAX-RS/pathParams}}{{>libraries/JAX-RS/headerParams}}{{>libraries/JAX-RS/bodyParams}}{{>libraries/JAX-RS/formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}) {\n\n    // do something\n\n    return null;\n  }\n{{/operation}}\n}\n{{/operations}}\n"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/JAX-RS/bodyParams.mustache",
    "content": "{{#isBodyParam}} {{{dataType}}} {{paramName}}{{/isBodyParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/JAX-RS/formParams.mustache",
    "content": "{{#isFormParam}}{{^isFile}} {{#vendorExtensions.x-multipart}} @FormDataParam(\"{{baseName}}\")  {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue(\"{{{defaultValue}}}\"){{/defaultValue}} @FormParam(\"{{baseName}}\")  {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/isFile}}{{#isFile}} Part {{paramName}}{{/isFile}}{{/isFormParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/JAX-RS/headerParams.mustache",
    "content": "{{#isHeaderParam}}@HeaderParam(\"{{baseName}}\") {{{dataType}}} {{paramName}}{{/isHeaderParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/JAX-RS/pathParams.mustache",
    "content": "{{#isPathParam}}@PathParam(\"{{paramName}}\") {{{dataType}}} {{paramName}}{{/isPathParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/JAX-RS/pom.mustache",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\n  {{#isMultipleModule}}\n    <parent>\n      <artifactId>{{artifactId}}</artifactId>\n      <groupId>{{groupId}}</groupId>\n      <version>{{artifactVersion}}</version>\n    </parent>\n  {{/isMultipleModule}}\n\n  <modelVersion>4.0.0</modelVersion>\n  <artifactId>{{providerArtifactId}}</artifactId>\n  <packaging>jar</packaging>\n{{^isMultipleModule}}\n  <groupId>{{groupId}}</groupId>\n  <version>{{artifactVersion}}</version>\n{{/isMultipleModule}}\n  <name>{{providerArtifactId}}</name>\n\n\n  <properties>\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <java-chassis.version>1.2.0</java-chassis.version>\n  </properties>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.apache.servicecomb</groupId>\n        <artifactId>java-chassis-dependencies</artifactId>\n        <version>${java-chassis.version}</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n  <dependencies>\n    {{#isMultipleModule}}\n      <dependency>\n        <groupId>{{groupId}}</groupId>\n        <artifactId>{{modelArtifactId}}</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n    {{/isMultipleModule}}\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-bizkeeper</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-loadbalance</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-flowcontrol-qps</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>transport-highway</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>transport-rest-vertx</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>provider-jaxrs</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-slf4j-impl</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-api</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-core</artifactId>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n        <version>3.1</version>\n        <configuration>\n          <source>1.8</source>\n          <target>1.8</target>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-resources-plugin</artifactId>\n        <version>3.0.0</version>\n        <configuration>\n          <encoding>UTF-8</encoding>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-maven-plugin</artifactId>\n        <version>1.5.12.RELEASE</version>\n        <configuration>\n          <fork>true</fork>\n          <mainClass>{{mainClassPackage}}.Application</mainClass>\n          <outputDirectory>target/bin</outputDirectory>\n        </configuration>\n        <executions>\n          <execution>\n            <goals>\n              <goal>repackage</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/JAX-RS/queryParams.mustache",
    "content": "{{#isQueryParam}} @QueryParam(\"{{baseName}}\") {{{dataType}}} {{paramName}}{{/isQueryParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/POJO/Application.mustache",
    "content": "package {{mainClassPackage}};\n\nimport org.apache.servicecomb.foundation.common.utils.BeanUtils;\n\npublic class Application {\n\n  public static void main(String[] args) throws Exception {\n    BeanUtils.init();\n  }\n}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/POJO/api.mustache",
    "content": "package {{apiPackage}};\n\nimport static org.springframework.http.MediaType.*;\nimport java.util.List;\nimport java.util.Map;\nimport java.io.File;\n{{#imports}}import {{import}};\n{{/imports}}\nimport org.apache.servicecomb.provider.pojo.RpcSchema;\nimport org.springframework.http.HttpStatus;\nimport org.springframework.http.ResponseEntity;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestHeader;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.RequestPart;\nimport org.springframework.web.multipart.MultipartFile;\n\n@RpcSchema(schemaId = \"{{#camelcase}}{{classname}}{{/camelcase}}\")\n{{#operations}}\npublic class {{classname}} {\n  {{#operation}}\n\n  public {{>returnTypes}} {{operationId}}({{#allParams}}{{>libraries/POJO/queryParams}}{{>libraries/POJO/pathParams}}{{>libraries/POJO/headerParams}}{{>libraries/POJO/bodyParams}}{{>libraries/POJO/formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {\n    // do something\n\n    return null;\n  }\n  {{/operation}}\n}\n{{/operations}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/POJO/bodyParams.mustache",
    "content": "{{#isBodyParam}} {{{dataType}}} {{paramName}}{{/isBodyParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/POJO/formParams.mustache",
    "content": "{{#isFormParam}}{{^isFile}}{{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}} File {{baseName}}{{/isFile}}{{/isFormParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/POJO/headerParams.mustache",
    "content": "{{#isHeaderParam}} {{{dataType}}} {{paramName}}{{/isHeaderParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/POJO/pathParams.mustache",
    "content": "{{#isPathParam}} {{{dataType}}} {{paramName}}{{/isPathParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/POJO/pom.mustache",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\n  {{#isMultipleModule}}\n    <parent>\n      <artifactId>{{artifactId}}</artifactId>\n      <groupId>{{groupId}}</groupId>\n      <version>{{artifactVersion}}</version>\n    </parent>\n  {{/isMultipleModule}}\n\n  <modelVersion>4.0.0</modelVersion>\n  <artifactId>{{providerArtifactId}}</artifactId>\n  <packaging>jar</packaging>\n{{^isMultipleModule}}\n  <groupId>{{groupId}}</groupId>\n  <version>{{artifactVersion}}</version>\n{{/isMultipleModule}}\n  <name>{{providerArtifactId}}</name>\n\n  <properties>\n      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n      <java-chassis.version>1.2.0</java-chassis.version>\n  </properties>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.apache.servicecomb</groupId>\n        <artifactId>java-chassis-dependencies</artifactId>\n        <version>${java-chassis.version}</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n  <dependencies>\n    {{#isMultipleModule}}\n      <dependency>\n        <groupId>{{groupId}}</groupId>\n        <artifactId>{{modelArtifactId}}</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n    {{/isMultipleModule}}\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-bizkeeper</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-loadbalance</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>transport-highway</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>transport-rest-vertx</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-flowcontrol-qps</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>provider-pojo</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-slf4j-impl</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-api</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-core</artifactId>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n        <version>3.1</version>\n        <configuration>\n          <source>1.8</source>\n          <target>1.8</target>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-resources-plugin</artifactId>\n        <version>3.0.0</version>\n        <configuration>\n          <encoding>UTF-8</encoding>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-maven-plugin</artifactId>\n        <version>1.5.12.RELEASE</version>\n        <configuration>\n          <fork>true</fork>\n          <mainClass>{{mainClassPackage}}.Application</mainClass>\n          <outputDirectory>target/bin</outputDirectory>\n        </configuration>\n        <executions>\n          <execution>\n            <goals>\n              <goal>repackage</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/POJO/queryParams.mustache",
    "content": "{{#isQueryParam}} {{{dataType}}} {{paramName}}{{/isQueryParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringBoot/Application.mustache",
    "content": "package {{mainClassPackage}};\n\nimport org.apache.servicecomb.springboot.starter.provider.EnableServiceComb;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\n@EnableServiceComb\npublic class Application {\n\n  public static void main(String[] args) throws Exception {\n    SpringApplication.run(Application.class, args);\n  }\n}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringBoot/api.mustache",
    "content": "package {{apiPackage}};\n\nimport static org.springframework.http.MediaType.*;\nimport java.util.List;\nimport java.util.Map;\n{{#imports}}import {{import}};\n{{/imports}}\nimport org.apache.servicecomb.provider.rest.common.RestSchema;\nimport org.springframework.http.HttpStatus;\nimport org.springframework.http.ResponseEntity;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestHeader;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.RequestPart;\nimport org.springframework.web.multipart.MultipartFile;\n\n@RestSchema(schemaId = \"{{#camelcase}}{{classname}}{{/camelcase}}\")\n@RequestMapping(value = \"{{#getRelativeBasePath}}{{basePath}}{{/getRelativeBasePath}}\", produces = {APPLICATION_JSON_VALUE})\n{{#operations}}\npublic class {{classname}} {\n\n  {{>libraries/SpringBoot/operationMethod}}\n}\n{{/operations}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringBoot/bodyParams.mustache",
    "content": "{{#isBodyParam}}@RequestBody {{{dataType}}} {{paramName}}{{/isBodyParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringBoot/formParams.mustache",
    "content": "{{#isFormParam}}{{^isFile}}@RequestPart(value=\"{{paramName}}\"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}})  {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@RequestPart(\"file\") MultipartFile {{baseName}}{{/isFile}}{{/isFormParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringBoot/headerParams.mustache",
    "content": "{{#isHeaderParam}}@RequestHeader(value=\"{{paramName}}\", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{{dataType}}} {{paramName}}{{/isHeaderParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringBoot/operationMethod.mustache",
    "content": "{{#operation}}\n\n  @RequestMapping(value = \"{{path}}\", {{#hasProduces}}produces = { {{#produces}}\"{{mediaType}}\"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}} {{#hasConsumes}}consumes = { {{#consumes}}\"{{mediaType}}\"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}} method = RequestMethod.{{httpMethod}})\n  public ResponseEntity<{{>returnTypes}}> {{operationId}}({{#allParams}}{{>libraries/SpringBoot/queryParams}}{{>libraries/SpringBoot/pathParams}}{{>libraries/SpringBoot/headerParams}}{{>libraries/SpringBoot/bodyParams}}{{>libraries/SpringBoot/formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {\n    // do something\n\n    return new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK);\n  }\n{{/operation}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringBoot/pathParams.mustache",
    "content": "{{#isPathParam}}@PathVariable(\"{{paramName}}\") {{{dataType}}} {{paramName}}{{/isPathParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringBoot/pom.mustache",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\n  {{#isMultipleModule}}\n    <parent>\n      <artifactId>{{artifactId}}</artifactId>\n      <groupId>{{groupId}}</groupId>\n      <version>{{artifactVersion}}</version>\n    </parent>\n  {{/isMultipleModule}}\n\n  <modelVersion>4.0.0</modelVersion>\n  <artifactId>{{providerArtifactId}}</artifactId>\n  <packaging>jar</packaging>\n{{^isMultipleModule}}\n  <groupId>{{groupId}}</groupId>\n  <version>{{artifactVersion}}</version>\n{{/isMultipleModule}}\n  <name>{{providerArtifactId}}</name>\n\n  <properties>\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <java-chassis.version>1.2.0</java-chassis.version>\n  </properties>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.apache.servicecomb</groupId>\n        <artifactId>java-chassis-dependencies</artifactId>\n        <version>${java-chassis.version}</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n  <dependencies>\n    {{#isMultipleModule}}\n      <dependency>\n        <groupId>{{groupId}}</groupId>\n        <artifactId>{{modelArtifactId}}</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n    {{/isMultipleModule}}\n\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>spring-boot-starter-provider</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-flowcontrol-qps</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-bizkeeper</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>handler-tracing-zipkin</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>inspector</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.hibernate.validator</groupId>\n      <artifactId>hibernate-validator</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>javax.validation</groupId>\n      <artifactId>validation-api</artifactId>\n      <version>2.0.1.Final</version>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n        <version>3.1</version>\n        <configuration>\n          <source>1.8</source>\n          <target>1.8</target>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-resources-plugin</artifactId>\n        <version>3.0.0</version>\n        <configuration>\n          <encoding>UTF-8</encoding>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-maven-plugin</artifactId>\n        <version>1.5.12.RELEASE</version>\n        <configuration>\n          <fork>true</fork>\n          <mainClass>{{mainClassPackage}}.Application</mainClass>\n          <outputDirectory>target/bin</outputDirectory>\n        </configuration>\n        <executions>\n          <execution>\n            <goals>\n              <goal>repackage</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringBoot/queryParams.mustache",
    "content": "{{#isQueryParam}}@RequestParam(value = \"{{paramName}}\"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue=\"{{{defaultValue}}}\"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isQueryParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringMVC/Application.mustache",
    "content": "package {{mainClassPackage}};\n\nimport org.apache.servicecomb.foundation.common.utils.BeanUtils;\n\npublic class Application {\n\n  public static void main(String[] args) throws Exception {\n    BeanUtils.init();\n  }\n}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringMVC/api.mustache",
    "content": "package {{apiPackage}};\n\nimport static org.springframework.http.MediaType.*;\nimport java.util.List;\nimport java.util.Map;\n{{#imports}}import {{import}};\n{{/imports}}\nimport org.apache.servicecomb.provider.rest.common.RestSchema;\nimport org.springframework.http.HttpStatus;\nimport org.springframework.http.ResponseEntity;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestHeader;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.RequestPart;\nimport org.springframework.web.multipart.MultipartFile;\n\n@RestSchema(schemaId = \"{{#camelcase}}{{classname}}{{/camelcase}}\")\n@RequestMapping(value = \"{{#getRelativeBasePath}}{{basePath}}{{/getRelativeBasePath}}\", produces = {APPLICATION_JSON_VALUE})\n{{#operations}}\npublic class {{classname}} {\n{{#operation}}\n\n  @RequestMapping(value = \"{{path}}\", {{#hasProduces}}produces = { {{#produces}}\"{{mediaType}}\"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}} {{#hasConsumes}}consumes = { {{#consumes}}\"{{mediaType}}\"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}method = RequestMethod.{{httpMethod}})\n  public ResponseEntity<{{>returnTypes}}> {{operationId}}({{#allParams}}{{>libraries/SpringMVC/queryParams}}{{>libraries/SpringMVC/pathParams}}{{>libraries/SpringMVC/headerParams}}{{>libraries/SpringMVC/bodyParams}}{{>libraries/SpringMVC/formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {\n    // do something\n\n    return new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK);\n  }\n{{/operation}}\n}\n{{/operations}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringMVC/bodyParams.mustache",
    "content": "{{#isBodyParam}}@RequestBody {{{dataType}}} {{paramName}}{{/isBodyParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringMVC/formParams.mustache",
    "content": "{{#isFormParam}}{{^isFile}}@RequestPart(value=\"{{baseName}}\"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}})  {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@RequestPart(\"file\") MultipartFile {{baseName}}{{/isFile}}{{/isFormParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringMVC/headerParams.mustache",
    "content": "{{#isHeaderParam}}@RequestHeader(value=\"{{paramName}}\", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{{dataType}}} {{paramName}}{{/isHeaderParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringMVC/pathParams.mustache",
    "content": "{{#isPathParam}}@PathVariable(\"{{paramName}}\") {{{dataType}}} {{paramName}}{{/isPathParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringMVC/pom.mustache",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\n  {{#isMultipleModule}}\n  <parent>\n    <artifactId>{{artifactId}}</artifactId>\n    <groupId>{{groupId}}</groupId>\n    <version>{{artifactVersion}}</version>\n  </parent>\n  {{/isMultipleModule}}\n\n  <modelVersion>4.0.0</modelVersion>\n  <artifactId>{{providerArtifactId}}</artifactId>\n  <packaging>jar</packaging>\n{{^isMultipleModule}}\n  <groupId>{{groupId}}</groupId>\n  <version>{{artifactVersion}}</version>\n{{/isMultipleModule}}\n  <name>{{providerArtifactId}}</name>\n\n  <properties>\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <java-chassis.version>1.2.0</java-chassis.version>\n  </properties>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.apache.servicecomb</groupId>\n        <artifactId>java-chassis-dependencies</artifactId>\n        <version>${java-chassis.version}</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n  <dependencies>\n{{#isMultipleModule}}\n    <dependency>\n      <groupId>{{groupId}}</groupId>\n      <artifactId>{{modelArtifactId}}</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n{{/isMultipleModule}}\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>transport-rest-vertx</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>transport-highway</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>provider-springmvc</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-slf4j-impl</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-api</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.logging.log4j</groupId>\n      <artifactId>log4j-core</artifactId>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n        <version>3.1</version>\n        <configuration>\n          <source>1.8</source>\n          <target>1.8</target>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-resources-plugin</artifactId>\n        <version>3.0.0</version>\n        <configuration>\n          <encoding>UTF-8</encoding>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-maven-plugin</artifactId>\n        <version>1.5.12.RELEASE</version>\n        <configuration>\n          <fork>true</fork>\n          <mainClass>{{mainClassPackage}}.Application</mainClass>\n          <outputDirectory>target/bin</outputDirectory>\n        </configuration>\n        <executions>\n          <execution>\n            <goals>\n              <goal>repackage</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/libraries/SpringMVC/queryParams.mustache",
    "content": "{{#isQueryParam}}@RequestParam(value = \"{{paramName}}\"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue=\"{{{defaultValue}}}\"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isQueryParam}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/log4j2.mustache",
    "content": "<!--this is sample configuration, please modify as your wish-->\n<configuration>\n  <Properties>\n    <Property name=\"log_path\">./target/log</Property>\n  </Properties>\n\n  <Appenders>\n    <Console name=\"Console\" target=\"SYSTEM_OUT\">\n      <PatternLayout pattern=\"[%d][%t][%p][%c:%L] %m%n\"/>\n    </Console>\n    <RollingFile name=\"DailyRollingFile\" fileName=\"${log_path}/output.log\"\n      filePattern=\"${log_path}/%d{yyyy-MM-dd}.log\">\n      <PatternLayout pattern=\"[%d][%t][%p][%c:%L] %m%n\"/>\n      <TimeBasedTriggeringPolicy interval=\"1\"/>\n    </RollingFile>\n  </Appenders>\n  <Loggers>\n    <Root level=\"info\">\n      <AppenderRef ref=\"Console\"/>\n      <AppenderRef ref=\"DailyRollingFile\"/>\n    </Root>\n  </Loggers>\n</configuration>"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/model/model.mustache",
    "content": "package {{package}};\n\n{{#imports}}import {{import}};\n{{/imports}}\n{{#withXml}}\nimport javax.xml.bind.annotation.*;\n{{/withXml}}\n\n{{#models}}\n{{#model}}\n{{#isEnum}}\n{{>enumOuterClass}}\n{{/isEnum}}\n{{^isEnum}}\n{{>pojo}}\n{{/isEnum}}\n{{/model}}\n{{/models}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/model/pom.mustache",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\n  <parent>\n    <artifactId>{{artifactId}}</artifactId>\n    <groupId>{{groupId}}</groupId>\n    <version>{{artifactVersion}}</version>\n  </parent>\n\n  <modelVersion>4.0.0</modelVersion>\n  <artifactId>{{modelArtifactId}}</artifactId>\n  <packaging>jar</packaging>\n  <name>{{modelArtifactId}}</name>\n\n  <properties>\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <java-chassis.version>1.2.0</java-chassis.version>\n  </properties>\n\n  <dependencies>\n    {{^isPOJO}}\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-web</artifactId>\n    </dependency>\n    {{/isPOJO}}\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n        <version>3.1</version>\n        <configuration>\n          <source>1.8</source>\n          <target>1.8</target>\n        </configuration>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/pojo.mustache",
    "content": "{{#useBeanValidation}}@Validated{{/useBeanValidation}}\n{{#discriminator}}{{/discriminator}}\npublic class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} {\n  {{#serializableModel}}\n  private static final long serialVersionUID = 1L;\n  {{/serializableModel}}\n\n  {{#vars}}\n  {{#isEnum}}\n  {{^isContainer}}\n  {{>enumClass}}\n  {{/isContainer}}\n  {{/isEnum}}\n  {{#items.isEnum}}\n  {{#items}}\n  {{^isContainer}}\n  {{>enumClass}}\n  {{/isContainer}}\n  {{/items}}\n  {{/items.isEnum}}\n  {{#gson}}\n  @SerializedName(\"{{baseName}}\")\n  {{/gson}}\n  {{#isContainer}}\n  {{#useBeanValidation}}@Valid{{/useBeanValidation}}\n  private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};\n  {{/isContainer}}\n  {{^isContainer}}\n    private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{defaultValue}}} {{/defaultValue}}{{/required}};\n  {{/isContainer}}\n  {{/vars}}\n\n  {{#vars}}\n  public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {\n    this.{{name}} = {{name}};\n    return this;\n  }\n\n  {{#isListContainer}}\n  public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {\n  {{^required}}\n    if (this.{{name}} == null) {\n      this.{{name}} = {{{defaultValue}}};\n    }\n  {{/required}}\n    this.{{name}}.add({{name}}Item);\n    return this;\n  }\n  {{/isListContainer}}\n\n  {{#isMapContainer}}\n  public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {\n  {{^required}}\n    if (this.{{name}} == null) {\n      this.{{name}} = {{{defaultValue}}};\n    }\n  {{/required}}\n    this.{{name}}.put(key, {{name}}Item);\n    return this;\n  }\n  {{/isMapContainer}}\n\n  {{#vendorExtensions.extraAnnotation}}\n  {{{vendorExtensions.extraAnnotation}}}\n  {{/vendorExtensions.extraAnnotation}}\n  {{#useBeanValidation}}\n  {{>beanValidation}}\n  {{/useBeanValidation}}\n  public {{{datatypeWithEnum}}} {{#isBoolean}}is{{/isBoolean}}{{getter}}() {\n    return {{name}};\n  }\n\n  public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {\n    this.{{name}} = {{name}};\n  }\n{{/vars}}\n}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/project/pom.mustache",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>{{groupId}}</groupId>\n  <artifactId>{{artifactId}}</artifactId>\n  <packaging>pom</packaging>\n  <name>{{artifactId}}</name>\n  <version>{{artifactVersion}}</version>\n\n  <properties>\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <java-chassis.version>1.2.0</java-chassis.version>\n    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>\n    <java.version>1.8</java.version>\n  </properties>\n\n  <modules>\n    {{#modules}}\n      <module>{{module}}</module>\n    {{/modules}}\n  </modules>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.apache.servicecomb</groupId>\n        <artifactId>java-chassis-dependencies</artifactId>\n        <version>${java-chassis.version}</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n</project>"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/provider/microservice.mustache",
    "content": "#Indicates an application name\nAPPLICATION_ID: {{applicationId}}\nservice_description:\n#Indicates a microservice name\n#The microservice name should be unique within an application.\n#The name can contain digits, uppercase and lowercase letters, hyphens(-), underscores(_), and periods(.); and can neither start nor end with punctuations.\n#The naming rule is as follows: ^[a-zA-Z0-9]+$|^[a-zA-Z0-9][a-zA-Z0-9_-.]*[a-zA-Z0-9]$.\n  name: {{providerServiceId}}\n#Indicates a service version\n  version: 1.0.0\nservicecomb:\n  service:\n  #Specifies the service center IP address.\n    registry:\n      address: http://127.0.0.1:30100\n  #Specifies the rest transport listening IP address.\n  rest:\n    address: 0.0.0.0:8080\n{{#isPOJO}}\n  #Specifies the highway transport listening IP address.\n  highway:\n    address: 0.0.0.0:7070\n{{/isPOJO}}"
  },
  {
    "path": "codegen/src/main/resources/ServiceComb/returnTypes.mustache",
    "content": "{{#returnContainer}}{{#isMapContainer}}Map<String, {{{returnType}}}>{{/isMapContainer}}{{#isListContainer}}List<{{returnType}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/consumer/openfeign/Application.mustache",
    "content": "package {{mainClassPackage}};\n\nimport org.springframework.boot.WebApplicationType;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\nimport org.springframework.boot.builder.SpringApplicationBuilder;\nimport org.springframework.cloud.client.discovery.EnableDiscoveryClient;\nimport org.springframework.cloud.openfeign.EnableFeignClients;\n\n@EnableFeignClients\n@EnableDiscoveryClient\n@SpringBootApplication\npublic class Application {\n\n  public static void main(String[] args) {\n    new SpringApplicationBuilder(Application.class)\n        .web(WebApplicationType.SERVLET).run(args);\n  }\n}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/consumer/openfeign/apiConsumer.mustache",
    "content": "package {{apiPackage}};\n\nimport static org.springframework.http.MediaType.*;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.HashMap;\n{{#imports}}import {{import}};\n{{/imports}}\nimport org.springframework.cloud.openfeign.FeignClient;\nimport org.springframework.util.MultiValueMap;\nimport org.springframework.http.*;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestHeader;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.RequestPart;\nimport org.springframework.web.client.RestTemplate;\nimport org.springframework.web.multipart.MultipartFile;\n\n{{#operations}}\n@FeignClient(name = \"{{providerServiceId}}\")\n\n{{#showBasePath}}\n{{#basePath}}\n@RequestMapping(value = \"{{#getRelativeBasePath}}{{basePath}}{{/getRelativeBasePath}}\" )\n{{/basePath}}\n{{/showBasePath}}\npublic interface {{classname}} {\n{{#operation}}\n\n  @RequestMapping(value = \"{{path}}\", {{#hasProduces}}produces = { {{#produces}}\"{{mediaType}}\"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}} {{#hasConsumes}}consumes = { {{#consumes}}\"{{mediaType}}\"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}} method = RequestMethod.{{httpMethod}})\n  {{>provider/servlet/returnTypes}} {{operationId}}({{#allParams}}{{>consumer/openfeign/queryParamsConsumer}}{{>consumer/openfeign/headerParamsConsumer}}{{>consumer/openfeign/bodyParamsConsumer}}{{>consumer/openfeign/formParamsConsumer}}{{>consumer/openfeign/pathParamsConsumer}}{{#hasMore}}, {{/hasMore}}{{/allParams}});\n\n{{/operation}}\n}\n{{/operations}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/consumer/openfeign/applicationYml.mustache",
    "content": "spring:\n  application:\n    name: {{consumerServiceId}}\nserver:\n  port: 0\neureka:\n  instance:\n    hostname: localhost\n  client:\n    serviceUrl:\n      defaultZone: http://${eureka.instance.hostname}:8761/eureka/"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/consumer/openfeign/bodyParamsConsumer.mustache",
    "content": "{{#isBodyParam}}@RequestBody {{{dataType}}} {{paramName}}{{/isBodyParam}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/consumer/openfeign/formParamsConsumer.mustache",
    "content": "{{#isFormParam}}{{^isFile}}@RequestPart(value=\"{{baseName}}\"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}})  {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@RequestPart(\"file\") MultipartFile {{baseName}}{{/isFile}}{{/isFormParam}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/consumer/openfeign/headerParamsConsumer.mustache",
    "content": "{{#isHeaderParam}}@RequestHeader(value=\"{{paramName}}\", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{{dataType}}} {{paramName}}{{/isHeaderParam}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/consumer/openfeign/pathParamsConsumer.mustache",
    "content": "{{#isPathParam}}@PathVariable(\"{{paramName}}\") {{{dataType}}} {{paramName}}{{/isPathParam}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/consumer/openfeign/pom.mustache",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>{{groupId}}</groupId>\n  <artifactId>{{consumerArtifactId}}</artifactId>\n  <packaging>jar</packaging>\n  <name>{{consumerArtifactId}}</name>\n  <version>{{artifactVersion}}</version>\n\n  <properties>\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <spring-cloud.version>Greenwich.SR2</spring-cloud.version>\n  </properties>\n\n  <dependencies>\n\n  {{#isMultipleModule}}\n        <dependency>\n          <groupId>{{groupId}}</groupId>\n          <artifactId>{{modelArtifactId}}</artifactId>\n          <version>{{artifactVersion}}</version>\n        </dependency>\n  {{/isMultipleModule}}\n        <dependency>\n            <groupId>org.springframework.cloud</groupId>\n            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.springframework.boot</groupId>\n            <artifactId>spring-boot-starter-web</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.springframework.boot</groupId>\n            <artifactId>spring-boot-starter-actuator</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.springframework.cloud</groupId>\n            <artifactId>spring-cloud-starter-openfeign</artifactId>\n        </dependency>\n        <dependency>\n            <groupId>org.springframework.cloud</groupId>\n            <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>\n        </dependency>\n  </dependencies>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.springframework.cloud</groupId>\n        <artifactId>spring-cloud-dependencies</artifactId>\n        <version>${spring-cloud.version}</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n      <dependency>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-starter-parent</artifactId>\n        <version>2.1.8.RELEASE</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n        <version>3.1</version>\n        <configuration>\n          <source>1.8</source>\n          <target>1.8</target>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-resources-plugin</artifactId>\n        <version>3.0.0</version>\n        <configuration>\n          <encoding>UTF-8</encoding>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-maven-plugin</artifactId>\n        <configuration>\n          <fork>true</fork>\n          <mainClass>{{mainClassPackage}}.Application</mainClass>\n          <outputDirectory>target/bin</outputDirectory>\n        </configuration>\n        <executions>\n          <execution>\n            <goals>\n              <goal>repackage</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/consumer/openfeign/queryParamsConsumer.mustache",
    "content": "{{#isQueryParam}}@RequestParam(value = \"{{paramName}}\"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue=\"{{{defaultValue}}}\"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isQueryParam}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/model/enumClass.mustache",
    "content": "public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {\n{{#gson}}\n  {{#allowableValues}}\n  {{#enumVars}}\n  @SerializedName({{#isInteger}}\"{{/isInteger}}{{#isDouble}}\"{{/isDouble}}{{#isLong}}\"{{/isLong}}{{#isFloat}}\"{{/isFloat}}{{{value}}}{{#isInteger}}\"{{/isInteger}}{{#isDouble}}\"{{/isDouble}}{{#isLong}}\"{{/isLong}}{{#isFloat}}\"{{/isFloat}})\n  {{{name}}}({{{value}}}){{^-last}},\n  {{/-last}}{{#-last}};{{/-last}}\n  {{/enumVars}}\n  {{/allowableValues}}\n{{/gson}}\n{{^gson}}\n  {{#allowableValues}}\n  {{#enumVars}}\n  {{{name}}}({{{value}}}){{^-last}},\n  {{/-last}}{{#-last}};{{/-last}}\n  {{/enumVars}}\n  {{/allowableValues}}\n{{/gson}}\n\n  private {{{datatype}}} value;\n\n  {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{datatype}}} value) {\n    this.value = value;\n  }\n\n  @Override\n  public String toString() {\n    return String.valueOf(value);\n  }\n\n  public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) {\n    for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {\n      if (String.valueOf(b.value).equals(text)) {\n        return b;\n      }\n    }\n\n    return null;\n  }\n}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/model/enumOuterClass.mustache",
    "content": "public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {\n{{#gson}}\n  {{#allowableValues}}{{#enumVars}}\n  @SerializedName({{#isInteger}}\"{{/isInteger}}{{#isDouble}}\"{{/isDouble}}{{#isLong}}\"{{/isLong}}{{#isFloat}}\"{{/isFloat}}{{{value}}}{{#isInteger}}\"{{/isInteger}}{{#isDouble}}\"{{/isDouble}}{{#isLong}}\"{{/isLong}}{{#isFloat}}\"{{/isFloat}})\n  {{{name}}}({{{value}}}){{^-last}},\n  {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}}\n{{/gson}}\n{{^gson}}\n  {{#allowableValues}}{{#enumVars}}\n  {{{name}}}({{{value}}}){{^-last}},\n  {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}}\n{{/gson}}\n\n  private {{{dataType}}} value;\n\n  {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) {\n    this.value = value;\n  }\n\n  @Override\n  public String toString() {\n    return String.valueOf(value);\n  }\n\n  public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) {\n    for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {\n      if (String.valueOf(b.value).equals(text)) {\n        return b;\n      }\n    }\n\n    return null;\n  }\n}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/model/model.mustache",
    "content": "package {{package}};\n\n{{#imports}}import {{import}};\n{{/imports}}\n{{#withXml}}\nimport javax.xml.bind.annotation.*;\n{{/withXml}}\n\n{{#models}}\n{{#model}}\n{{#isEnum}}\n{{>model/enumOuterClass}}\n{{/isEnum}}\n{{^isEnum}}\n{{>model/pojo}}\n{{/isEnum}}\n{{/model}}\n{{/models}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/model/pojo.mustache",
    "content": "{{#useBeanValidation}}@Validated{{/useBeanValidation}}\n{{#discriminator}}{{/discriminator}}\npublic class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} {\n  {{#serializableModel}}\n  private static final long serialVersionUID = 1L;\n  {{/serializableModel}}\n\n  {{#vars}}\n  {{#isEnum}}\n  {{^isContainer}}\n  {{>model/enumClass}}\n  {{/isContainer}}\n  {{/isEnum}}\n  {{#items.isEnum}}\n  {{#items}}\n  {{^isContainer}}\n  {{>model/enumClass}}\n  {{/isContainer}}\n  {{/items}}\n  {{/items.isEnum}}\n  {{#gson}}\n  @SerializedName(\"{{baseName}}\")\n  {{/gson}}\n  {{#isContainer}}\n  {{#useBeanValidation}}@Valid{{/useBeanValidation}}\n  private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};\n  {{/isContainer}}\n  {{^isContainer}}\n  private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{defaultValue}}} {{/defaultValue}}{{/required}};\n  {{/isContainer}}\n  {{/vars}}\n\n  {{#vars}}\n  public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {\n    this.{{name}} = {{name}};\n    return this;\n  }\n\n  {{#isListContainer}}\n  public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {\n  {{^required}}\n    if (this.{{name}} == null) {\n      this.{{name}} = {{{defaultValue}}};\n    }\n  {{/required}}\n    this.{{name}}.add({{name}}Item);\n    return this;\n  }\n  {{/isListContainer}}\n\n  {{#isMapContainer}}\n  public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {\n  {{^required}}\n    if (this.{{name}} == null) {\n      this.{{name}} = {{{defaultValue}}};\n    }\n  {{/required}}\n    this.{{name}}.put(key, {{name}}Item);\n    return this;\n  }\n  {{/isMapContainer}}\n\n  {{#vendorExtensions.extraAnnotation}}\n  {{{vendorExtensions.extraAnnotation}}}\n  {{/vendorExtensions.extraAnnotation}}\n  public {{{datatypeWithEnum}}} {{#isBoolean}}is{{/isBoolean}}{{getter}}() {\n    return {{name}};\n  }\n\n  public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {\n    this.{{name}} = {{name}};\n  }\n{{/vars}}\n}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/model/pom.mustache",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\n  <parent>\n    <artifactId>{{artifactId}}</artifactId>\n    <groupId>{{groupId}}</groupId>\n    <version>{{artifactVersion}}</version>\n  </parent>\n\n  <modelVersion>4.0.0</modelVersion>\n  <artifactId>{{modelArtifactId}}</artifactId>\n  <packaging>jar</packaging>\n  <name>{{modelArtifactId}}</name>\n\n  <properties>\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <java-chassis.version>1.2.0</java-chassis.version>\n  </properties>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n        <version>3.1</version>\n        <configuration>\n          <source>1.8</source>\n          <target>1.8</target>\n        </configuration>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/project/pom.mustache",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>{{groupId}}</groupId>\n  <artifactId>{{artifactId}}</artifactId>\n  <packaging>pom</packaging>\n  <name>{{artifactId}}</name>\n  <version>{{artifactVersion}}</version>\n\n  <properties>\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <java-chassis.version>1.2.0</java-chassis.version>\n    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>\n    <java.version>1.8</java.version>\n  </properties>\n\n  <modules>\n    {{#modules}}\n      <module>{{module}}</module>\n    {{/modules}}\n  </modules>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.apache.servicecomb</groupId>\n        <artifactId>java-chassis-dependencies</artifactId>\n        <version>${java-chassis.version}</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n</project>"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/provider/servlet/Application.mustache",
    "content": "package {{mainClassPackage}};\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\npublic class Application {\n\n  public static void main(String[] args) {\n    SpringApplication.run(Application.class, args);\n  }\n}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/provider/servlet/api.mustache",
    "content": "package {{apiPackage}};\n\nimport static org.springframework.http.MediaType.*;\nimport java.util.List;\nimport java.util.Map;\n{{#imports}}import {{import}};\n{{/imports}}\nimport org.springframework.http.HttpStatus;\nimport org.springframework.http.ResponseEntity;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestHeader;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.RequestPart;\nimport org.springframework.web.multipart.MultipartFile;\nimport org.springframework.web.bind.annotation.RestController;\n\n@RestController\n@RequestMapping(value = \"{{#getRelativeBasePath}}{{basePath}}{{/getRelativeBasePath}}\", produces = {APPLICATION_JSON_VALUE})\n{{#operations}}\npublic class {{classname}} {\n{{#operation}}\n\n  @RequestMapping(value = \"{{path}}\", {{#hasProduces}}produces = { {{#produces}}\"{{mediaType}}\"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}} {{#hasConsumes}}consumes = { {{#consumes}}\"{{mediaType}}\"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}method = RequestMethod.{{httpMethod}})\n  public {{>provider/servlet/returnTypes}} {{operationId}}({{#allParams}}{{>provider/servlet/queryParams}}{{>provider/servlet/pathParams}}{{>provider/servlet/headerParams}}{{>provider/servlet/bodyParams}}{{>provider/servlet/formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {\n    // do something\n    return null;\n  }\n{{/operation}}\n}\n{{/operations}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/provider/servlet/applicationYml.mustache",
    "content": "spring:\n  application:\n    name: {{providerServiceId}}\nserver:\n  port: 0\neureka:\n  instance:\n    hostname: localhost\n  client:\n    serviceUrl:\n      defaultZone: http://${eureka.instance.hostname}:8761/eureka/"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/provider/servlet/bodyParams.mustache",
    "content": "{{#isBodyParam}}@RequestBody {{{dataType}}} {{paramName}}{{/isBodyParam}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/provider/servlet/formParams.mustache",
    "content": "{{#isFormParam}}{{^isFile}}@RequestPart(value=\"{{paramName}}\"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}})  {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@RequestPart(\"file\") MultipartFile {{baseName}}{{/isFile}}{{/isFormParam}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/provider/servlet/headerParams.mustache",
    "content": "{{#isHeaderParam}}@RequestHeader(value=\"{{paramName}}\", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{{dataType}}} {{paramName}}{{/isHeaderParam}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/provider/servlet/pathParams.mustache",
    "content": "{{#isPathParam}}@PathVariable(\"{{paramName}}\") {{{dataType}}} {{paramName}}{{/isPathParam}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/provider/servlet/pom.mustache",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>{{groupId}}</groupId>\n  <artifactId>{{providerArtifactId}}</artifactId>\n  <packaging>jar</packaging>\n  <name>{{providerArtifactId}}</name>\n  <version>{{artifactVersion}}</version>\n\n  <properties>\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <spring-cloud.version>Greenwich.SR2</spring-cloud.version>\n  </properties>\n\n  <dependencies>\n    {{#isMultipleModule}}\n    <dependency>\n      <groupId>{{groupId}}</groupId>\n      <artifactId>{{modelArtifactId}}</artifactId>\n      <version>{{artifactVersion}}</version>\n    </dependency>\n    {{/isMultipleModule}}\n    <dependency>\n      <groupId>org.springframework.cloud</groupId>\n      <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-web</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-actuator</artifactId>\n    </dependency>\n  </dependencies>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.springframework.cloud</groupId>\n        <artifactId>spring-cloud-dependencies</artifactId>\n        <version>${spring-cloud.version}</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n      <dependency>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-starter-parent</artifactId>\n        <version>2.1.8.RELEASE</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n        <version>3.1</version>\n        <configuration>\n          <source>\n          1.8</source>\n          <target>1.8</target>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-resources-plugin</artifactId>\n        <version>3.0.0</version>\n        <configuration>\n          <encoding>UTF-8</encoding>\n        </configuration>\n      </plugin>\n\n      <plugin>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-maven-plugin</artifactId>\n        <configuration>\n          <fork>true</fork>\n          <mainClass>{{mainClassPackage}}.Application</mainClass>\n          <outputDirectory>target/bin</outputDirectory>\n        </configuration>\n        <executions>\n          <execution>\n            <goals>\n              <goal>repackage</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/provider/servlet/queryParams.mustache",
    "content": "{{#isQueryParam}}@RequestParam(value = \"{{paramName}}\"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue=\"{{{defaultValue}}}\"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isQueryParam}}"
  },
  {
    "path": "codegen/src/main/resources/SpringCloud/provider/servlet/returnTypes.mustache",
    "content": "{{#returnContainer}}{{#isMapContainer}}Map<String, {{{returnType}}}>{{/isMapContainer}}{{#isListContainer}}List<{{returnType}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}"
  },
  {
    "path": "codegen/src/test/java/org/apache/servicecomb/toolkit/codegen/CustomPropertiesTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport org.junit.Assert;\nimport org.junit.Test;\n\npublic class CustomPropertiesTest {\n\n  @Test\n  public void customMainClassPackage() {\n\n    AbstractJavaCodegenExt javaCodegenExt = new AbstractJavaCodegenExt() {\n    };\n\n    javaCodegenExt.additionalProperties().put(\"mainClassPackage\", \"com.demo\");\n    javaCodegenExt.processOpts();\n\n    Assert.assertEquals(\"com.demo\", javaCodegenExt.mainClassPackage);\n  }\n\n  @Test\n  public void customApiPackage() {\n\n    AbstractJavaCodegenExt javaCodegenExt = new AbstractJavaCodegenExt() {\n    };\n\n    javaCodegenExt.additionalProperties().put(\"apiPackage\", \"com.demo.api\");\n    javaCodegenExt.processOpts();\n\n    Assert.assertEquals(\"com.demo\", javaCodegenExt.mainClassPackage);\n  }\n}\n"
  },
  {
    "path": "codegen/src/test/java/org/apache/servicecomb/toolkit/codegen/GeneratorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport static org.junit.Assert.fail;\n\nimport java.io.IOException;\nimport java.net.URISyntaxException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Collections;\n\nimport org.apache.servicecomb.toolkit.CodeGenerator;\nimport org.apache.servicecomb.toolkit.GeneratorFactory;\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.openapitools.codegen.CodegenType;\nimport org.openapitools.codegen.config.CodegenConfigurator;\n\npublic class GeneratorTest {\n\n  @Test\n  public void testGenerateProgrammingModels()\n      throws IOException, URISyntaxException, NoSuchFieldException, IllegalAccessException {\n\n    generateServiceCombCode(\"SpringMVC\");\n    generateServiceCombCode(\"POJO\");\n    generateServiceCombCode(\"JAX-RS\");\n    generateServiceCombCode(\"SpringBoot\");\n  }\n\n  private void generateServiceCombCode(String programmingModel)\n      throws IOException, URISyntaxException, IllegalAccessException, NoSuchFieldException {\n\n    Path tempDir = Files.createTempDirectory(null);\n    Path specFilePath = Paths.get(GeneratorTest.class.getClassLoader().getResource(\"swagger.yaml\").toURI());\n    CodegenConfigurator configurator = new CodegenConfigurator();\n\n    configurator.setGeneratorName(\"ServiceComb\");\n    configurator.setLibrary(programmingModel);\n    configurator.setOutputDir(tempDir.toFile().getCanonicalPath() + \"/ServiceComb\");\n    configurator.setInputSpec(specFilePath.toFile().getCanonicalPath());\n    configurator.addAdditionalProperty(GeneratorExternalConfigConstant.PROVIDER_PROJECT_NAME, \"mock-provider\");\n    configurator.addAdditionalProperty(GeneratorExternalConfigConstant.CONSUMER_PROJECT_NAME, \"mock-consumer\");\n    configurator.addAdditionalProperty(GeneratorExternalConfigConstant.MODEL_PROJECT_NAME, \"mock-model\");\n    DefaultCodeGenerator codeGenerator = new DefaultCodeGenerator();\n    codeGenerator.configure(Collections.singletonMap(\"configurators\", Collections.singletonList(configurator)));\n\n    try {\n      codeGenerator.generate();\n    } catch (RuntimeException e) {\n      fail(\"Run 'testGenerateProgrammingModels' failed while input \" + programmingModel\n          + \" unexpected to catch RuntimeException: \" + e.getMessage());\n    }\n\n    Object internalGenerator = ReflectUtils.getProperty(codeGenerator, \"generator\");\n    Assert.assertEquals(MultiContractGenerator.class, internalGenerator.getClass());\n    Object swaggerCodegenConfig = ReflectUtils.getProperty(internalGenerator, \"config\");\n    Assert.assertEquals(ServiceCombCodegen.class, swaggerCodegenConfig.getClass());\n    Assert.assertEquals(\"ServiceComb\", ((ServiceCombCodegen) swaggerCodegenConfig).getName());\n    Assert.assertEquals(CodegenType.SERVER, ((ServiceCombCodegen) swaggerCodegenConfig).getTag());\n\n    tempDir.toFile().deleteOnExit();\n  }\n\n  @Test\n  public void testGetCodeGeneratorInstanse() {\n\n    CodeGenerator defaultCodeGenerator = GeneratorFactory.getGenerator(CodeGenerator.class, \"default\");\n    Assert.assertNotNull(defaultCodeGenerator);\n    Assert.assertTrue(defaultCodeGenerator.canProcess(\"default\"));\n\n    CodeGenerator unknownCodeGenerator = GeneratorFactory.getGenerator(CodeGenerator.class, \"unknown\");\n    Assert.assertNull(unknownCodeGenerator);\n  }\n\n  @Test\n  public void generateSpringCloudProject()\n      throws IOException, URISyntaxException, IllegalAccessException, NoSuchFieldException {\n\n    Path tempDir = Files.createTempDirectory(null);\n    Path specFilePath = Paths.get(GeneratorTest.class.getClassLoader().getResource(\"swagger.yaml\").toURI());\n    CodegenConfigurator configurator = new CodegenConfigurator();\n\n    configurator.setGeneratorName(\"SpringCloud\");\n    configurator.setOutputDir(tempDir.toFile().getCanonicalPath() + \"/SpringCloud\");\n    configurator.setInputSpec(specFilePath.toFile().getCanonicalPath());\n    configurator.addAdditionalProperty(GeneratorExternalConfigConstant.PROVIDER_PROJECT_NAME, \"mock-provider\");\n    configurator.addAdditionalProperty(GeneratorExternalConfigConstant.CONSUMER_PROJECT_NAME, \"mock-consumer\");\n    configurator.addAdditionalProperty(GeneratorExternalConfigConstant.MODEL_PROJECT_NAME, \"mock-model\");\n    DefaultCodeGenerator codeGenerator = new DefaultCodeGenerator();\n    codeGenerator.configure(Collections.singletonMap(\"configurators\", Collections.singletonList(configurator)));\n\n    try {\n      codeGenerator.generate();\n    } catch (RuntimeException e) {\n      fail(\"Run 'testGenerateProgrammingModels' failed. Unexpected to catch RuntimeException: \" + e.getMessage());\n    }\n\n    Object internalGenerator = ReflectUtils.getProperty(codeGenerator, \"generator\");\n    Assert.assertEquals(MultiContractGenerator.class, internalGenerator.getClass());\n    Object swaggerCodegenConfig = ReflectUtils.getProperty(internalGenerator, \"config\");\n    Assert.assertEquals(SpringCloudCodegen.class, swaggerCodegenConfig.getClass());\n    Assert.assertEquals(\"SpringCloud\", ((SpringCloudCodegen) swaggerCodegenConfig).getName());\n    Assert.assertEquals(CodegenType.SERVER, ((SpringCloudCodegen) swaggerCodegenConfig).getTag());\n    Assert\n        .assertEquals(\"Generates a SpringCloud server library.\", ((SpringCloudCodegen) swaggerCodegenConfig).getHelp());\n\n    tempDir.toFile().deleteOnExit();\n  }\n}\n\n"
  },
  {
    "path": "codegen/src/test/java/org/apache/servicecomb/toolkit/codegen/ReflectUtils.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.lang.reflect.Field;\n\nclass ReflectUtils {\n\n  static Object getProperty(Object obj, String propName) throws IllegalAccessException, NoSuchFieldException {\n\n    Field propFiled = getFiled(obj.getClass(), propName);\n\n    if (propFiled == null) {\n      return null;\n    }\n\n    propFiled.setAccessible(true);\n    return propFiled.get(obj);\n  }\n\n  private static Field getFiled(Class cls, String propName) throws NoSuchFieldException {\n    try {\n      return cls.getDeclaredField(propName);\n    } catch (NoSuchFieldException e) {\n      if (cls.getSuperclass() != null) {\n        return getFiled(cls.getSuperclass(), propName);\n      } else {\n        throw new NoSuchFieldException(\"No such field: \" + propName);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codegen/src/test/java/org/apache/servicecomb/toolkit/codegen/ServiceCombCodegenTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.openapitools.codegen.CodegenConfig;\nimport org.openapitools.codegen.CodegenConfigLoader;\nimport org.openapitools.codegen.SupportingFile;\n\npublic class ServiceCombCodegenTest {\n\n  @Test\n  public void testLoadImpl() {\n    CodegenConfig codegenConfig = CodegenConfigLoader.forName(\"ServiceComb\");\n    Assert.assertEquals(ServiceCombCodegen.class, codegenConfig.getClass());\n  }\n\n  @Test\n  public void providerDirectoryStrategy() {\n\n    DirectoryStrategy providerDirectoryStrategy = new ProviderDirectoryStrategy();\n\n    Map<String, Object> propertiesMap = new HashMap<>();\n    propertiesMap.put(\"artifactId\", \"provider\");\n    propertiesMap.put(\"mainClassPackage\", \"provider\");\n    providerDirectoryStrategy.addCustomProperties(propertiesMap);\n    providerDirectoryStrategy.processSupportingFile(new ArrayList<SupportingFile>());\n    Assert.assertEquals(\"provider\", providerDirectoryStrategy.providerDirectory());\n    Assert.assertEquals(\"provider\", providerDirectoryStrategy.modelDirectory());\n\n    try {\n      providerDirectoryStrategy.consumerDirectory();\n    } catch (Exception e) {\n      Assert.assertTrue(e instanceof UnsupportedOperationException);\n    }\n  }\n\n  @Test\n  public void consumerDirectoryStrategy() {\n\n    DirectoryStrategy consumerDirectoryStrategy = new ConsumerDirectoryStrategy();\n\n    Map<String, Object> propertiesMap = new HashMap<>();\n    propertiesMap.put(\"artifactId\", \"consumer\");\n    propertiesMap.put(\"mainClassPackage\", \"consumer\");\n    propertiesMap.put(\"providerServiceId\", \"provider\");\n    propertiesMap.put(\"apiTemplateFiles\", new HashMap<String, String>());\n    consumerDirectoryStrategy.addCustomProperties(propertiesMap);\n    consumerDirectoryStrategy.processSupportingFile(new ArrayList<SupportingFile>());\n    Assert.assertEquals(\"consumer\", consumerDirectoryStrategy.consumerDirectory());\n    Assert.assertEquals(\"consumer\", consumerDirectoryStrategy.modelDirectory());\n\n    try {\n      consumerDirectoryStrategy.providerDirectory();\n    } catch (Exception e) {\n      Assert.assertTrue(e instanceof UnsupportedOperationException);\n    }\n  }\n\n  @Test\n  public void defaultDirectoryStrategy() {\n\n    DirectoryStrategy defaultDirectoryStrategy = new DefaultDirectoryStrategy();\n\n    Map<String, Object> propertiesMap = new HashMap<>();\n    propertiesMap.put(\"artifactId\", \"all\");\n    propertiesMap.put(\"mainClassPackage\", \"all\");\n    propertiesMap.put(\"apiTemplateFiles\", new HashMap<String, String>());\n    defaultDirectoryStrategy.addCustomProperties(propertiesMap);\n    defaultDirectoryStrategy.processSupportingFile(new ArrayList<SupportingFile>());\n    Assert.assertEquals(\"consumer\", defaultDirectoryStrategy.consumerDirectory());\n    Assert.assertEquals(\"provider\", defaultDirectoryStrategy.providerDirectory());\n    Assert.assertEquals(\"model\", defaultDirectoryStrategy.modelDirectory());\n  }\n\n  @Test\n  public void spirngCloudMultiDirectoryStrategy() {\n\n    SpringCloudMultiDirectoryStrategy multiDirectoryStrategy = new SpringCloudMultiDirectoryStrategy();\n\n    Map<String, Object> propertiesMap = new HashMap<>();\n    propertiesMap.put(\"artifactId\", \"all\");\n    propertiesMap.put(\"mainClassPackage\", \"all\");\n    propertiesMap.put(\"apiTemplateFiles\", new HashMap<String, String>());\n    multiDirectoryStrategy.addCustomProperties(propertiesMap);\n    multiDirectoryStrategy.processSupportingFile(new ArrayList<SupportingFile>());\n    Assert.assertEquals(\"consumer\", multiDirectoryStrategy.consumerDirectory());\n    Assert.assertEquals(\"provider\", multiDirectoryStrategy.providerDirectory());\n    Assert.assertEquals(\"model\", multiDirectoryStrategy.modelDirectory());\n  }\n\n  @Test\n  public void spirngCloudConsumerDirectoryStrategy() {\n\n    SpringCloudConsumerDirectoryStrategy consumerDirectoryStrategy = new SpringCloudConsumerDirectoryStrategy();\n\n    Map<String, Object> propertiesMap = new HashMap<>();\n    propertiesMap.put(\"artifactId\", \"consumer\");\n    propertiesMap.put(\"mainClassPackage\", \"consumer\");\n    propertiesMap.put(\"providerServiceId\", \"provider\");\n    propertiesMap.put(\"apiTemplateFiles\", new HashMap<String, String>());\n    consumerDirectoryStrategy.addCustomProperties(propertiesMap);\n    consumerDirectoryStrategy.processSupportingFile(new ArrayList<SupportingFile>());\n    Assert.assertEquals(\"consumer\", consumerDirectoryStrategy.consumerDirectory());\n    Assert.assertEquals(\"consumer\", consumerDirectoryStrategy.modelDirectory());\n\n    try {\n      consumerDirectoryStrategy.providerDirectory();\n    } catch (Exception e) {\n      Assert.assertTrue(e instanceof UnsupportedOperationException);\n    }\n  }\n\n  @Test\n  public void spirngCloudProviderDirectoryStrategy() {\n\n    SpringCloudProviderDirectoryStrategy providerDirectoryStrategy = new SpringCloudProviderDirectoryStrategy();\n\n    Map<String, Object> propertiesMap = new HashMap<>();\n    propertiesMap.put(\"artifactId\", \"provider\");\n    propertiesMap.put(\"mainClassPackage\", \"provider\");\n    providerDirectoryStrategy.addCustomProperties(propertiesMap);\n    providerDirectoryStrategy.processSupportingFile(new ArrayList<SupportingFile>());\n    Assert.assertEquals(\"provider\", providerDirectoryStrategy.providerDirectory());\n    Assert.assertEquals(\"provider\", providerDirectoryStrategy.modelDirectory());\n\n    try {\n      providerDirectoryStrategy.consumerDirectory();\n    } catch (Exception e) {\n      Assert.assertTrue(e instanceof UnsupportedOperationException);\n    }\n  }\n\n  @Test\n  public void defaultValue() {\n    CodegenConfig codegenConfig = CodegenConfigLoader.forName(\"ServiceComb\");\n    Assert.assertEquals(ServiceCombCodegen.class, codegenConfig.getClass());\n    ServiceCombCodegen serviceCombCodegen = (ServiceCombCodegen) codegenConfig;\n    serviceCombCodegen.processOpts();\n\n    Map<String, Object> additionalProperties = serviceCombCodegen.additionalProperties();\n    Assert.assertEquals(\"domain.orgnization.project.sample\", additionalProperties.get(\"mainClassPackage\"));\n    Assert.assertEquals(\"domain.orgnization.project.sample.api\", additionalProperties.get(\"apiPackage\"));\n    Assert.assertEquals(\"domain.orgnization.project.sample.model\", additionalProperties.get(\"modelPackage\"));\n  }\n}\n"
  },
  {
    "path": "codegen/src/test/java/org/apache/servicecomb/toolkit/codegen/SpringCloudCodegenTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.openapitools.codegen.CodegenConfig;\nimport org.openapitools.codegen.CodegenConfigLoader;\n\npublic class SpringCloudCodegenTest {\n\n  @Test\n  public void testLoadImpl() {\n    CodegenConfig codegenConfig = CodegenConfigLoader.forName(\"SpringCloud\");\n    Assert.assertEquals(SpringCloudCodegen.class, codegenConfig.getClass());\n  }\n}\n"
  },
  {
    "path": "codegen/src/test/java/org/apache/servicecomb/toolkit/codegen/TemplateTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.codegen;\n\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertNotNull;\nimport static org.junit.Assert.assertNull;\nimport static org.junit.Assert.assertTrue;\nimport static org.junit.Assert.fail;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\nimport org.junit.Test;\nimport org.openapitools.codegen.CodegenConfig;\nimport org.openapitools.codegen.CodegenModel;\nimport org.openapitools.codegen.api.TemplatingEngineAdapter;\nimport org.openapitools.codegen.templating.MustacheEngineAdapter;\n\nimport com.samskivert.mustache.Mustache;\nimport com.samskivert.mustache.Template;\n\nimport io.swagger.models.Model;\nimport io.swagger.models.Swagger;\nimport io.swagger.parser.OpenAPIParser;\nimport io.swagger.parser.SwaggerParser;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.media.Schema;\nimport io.swagger.v3.parser.core.models.ParseOptions;\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\n\npublic class TemplateTest {\n\n  String[] apiTemplateLocations = new String[] {\n      \"ServiceComb/libraries/JAX-RS/api.mustache\",\n      \"ServiceComb/libraries/POJO/api.mustache\",\n      \"ServiceComb/libraries/SpringBoot/api.mustache\",\n      \"ServiceComb/libraries/SpringMVC/api.mustache\",\n      \"ServiceComb/consumer/apiConsumer.mustache\",\n      \"ServiceComb/consumer/pojo/apiConsumer.mustache\"\n  };\n\n  @Test\n  public void generateApisWithNoModel() throws IOException {\n    ServiceCombCodegen config = new ServiceCombCodegen();\n\n    Map<String, Object> templateData = readSwaggerModelInfo(\"no-model.yaml\", config);\n\n    assertNotNull(templateData);\n    assertNull(templateData.get(\"imports\"));\n\n    templateData.putAll(config.additionalProperties());\n    templateData.put(\"apiPackage\", config.apiPackage());\n\n    Arrays.stream(apiTemplateLocations).forEach(apiTemplateLocation -> {\n      try {\n        String renderResult = renderTemplate(templateData, apiTemplateLocation);\n        assertNotNull(renderResult);\n        assertFalse(renderResult.contains(config.modelPackage()));\n      } catch (IOException e) {\n        fail(\"Run 'generateApisWithNoModel' failed: \" + e.getMessage());\n      }\n    });\n  }\n\n  @Test\n  public void generateApisWithModel() throws IOException {\n    ServiceCombCodegen config = new ServiceCombCodegen();\n    TemplatingEngineAdapter templateEngine = new MustacheEngineAdapter();\n    Map<String, Object> templateData = readSwaggerModelInfo(\"with-model.yaml\", config);\n\n    assertNotNull(templateData);\n    assertNotNull(templateData.get(\"imports\"));\n\n    templateData.putAll(config.additionalProperties());\n    templateData.put(\"apiPackage\", config.apiPackage());\n\n    Arrays.stream(apiTemplateLocations).forEach(apiTemplateLocation -> {\n      try {\n        String renderResult = renderTemplate(templateData, apiTemplateLocation);\n        assertNotNull(renderResult);\n        assertTrue(renderResult.contains(config.modelPackage()));\n      } catch (IOException e) {\n        fail(\"Run 'generateApisWithModel' failed: \" + e.getMessage());\n      }\n    });\n  }\n\n  private Map<String, Object> readSwaggerModelInfo(String swaggerYamlFile, CodegenConfig config) throws IOException {\n\n    Map<String, Object> templateData = new HashMap<>();\n    String swaggerString = readResourceInClasspath(swaggerYamlFile);\n    Swagger swagger = new SwaggerParser().parse(swaggerString);\n\n    ParseOptions options = new ParseOptions();\n    options.setResolve(true);\n    options.setFlatten(true);\n    SwaggerParseResult result = new OpenAPIParser().readContents(swaggerString, null, options);\n    OpenAPI openAPI = result.getOpenAPI();\n\n    Components components = openAPI.getComponents();\n\n    Map<String, Model> definitions = swagger.getDefinitions();\n    if (definitions == null) {\n      return templateData;\n    }\n    List<Map<String, String>> imports = new ArrayList<Map<String, String>>();\n    for (String key : components.getSchemas().keySet()) {\n      Schema mm = components.getSchemas().get(key);\n      CodegenModel cm = config.fromModel(key, mm);\n      Map<String, String> item = new HashMap<String, String>();\n      item.put(\"import\", config.toModelImport(cm.classname));\n      imports.add(item);\n    }\n    templateData.put(\"imports\", imports);\n    return templateData;\n  }\n\n  private String renderTemplate(Map<String, Object> templateData, String templateLocation) throws IOException {\n    String templateString = readResourceInClasspath(templateLocation);\n    Mustache.Compiler compiler = Mustache.compiler();\n    Template tmpl = compiler.compile(templateString);\n    return tmpl.execute(templateData);\n  }\n\n  private String readResourceInClasspath(String resourceName) throws IOException {\n    InputStream resourceStream = TemplateTest.class.getClassLoader().getResourceAsStream(resourceName);\n    if (resourceStream == null) {\n      throw new IOException(\"resource \" + resourceName + \" not found\");\n    }\n    StringBuilder stringBuilder = new StringBuilder();\n    int len = -1;\n    byte[] buffer = new byte[2048];\n    while ((len = resourceStream.read(buffer)) != -1) {\n      stringBuilder.append(new String(buffer, 0, len));\n    }\n    return stringBuilder.toString();\n  }\n}\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/json/api-with-examples.json",
    "content": "{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"title\": \"Simple API overview\",\n    \"version\": \"v2\"\n  },\n  \"paths\": {\n    \"/\": {\n      \"get\": {\n        \"operationId\": \"listVersionsv2\",\n        \"summary\": \"List API versions\",\n        \"produces\": [\n          \"application/json\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"200 300 response\",\n            \"examples\": {\n              \"application/json\": \"{\\n    \\\"versions\\\": [\\n        {\\n            \\\"status\\\": \\\"CURRENT\\\",\\n            \\\"updated\\\": \\\"2011-01-21T11:33:21Z\\\",\\n            \\\"id\\\": \\\"v2.0\\\",\\n            \\\"links\\\": [\\n                {\\n                    \\\"href\\\": \\\"http://127.0.0.1:8774/v2/\\\",\\n                    \\\"rel\\\": \\\"self\\\"\\n                }\\n            ]\\n        },\\n        {\\n            \\\"status\\\": \\\"EXPERIMENTAL\\\",\\n            \\\"updated\\\": \\\"2013-07-23T11:33:21Z\\\",\\n            \\\"id\\\": \\\"v3.0\\\",\\n            \\\"links\\\": [\\n                {\\n                    \\\"href\\\": \\\"http://127.0.0.1:8774/v3/\\\",\\n                    \\\"rel\\\": \\\"self\\\"\\n                }\\n            ]\\n        }\\n    ]\\n}\"\n            }\n          },\n          \"300\": {\n            \"description\": \"200 300 response\",\n            \"examples\": {\n              \"application/json\": \"{\\n    \\\"versions\\\": [\\n        {\\n            \\\"status\\\": \\\"CURRENT\\\",\\n            \\\"updated\\\": \\\"2011-01-21T11:33:21Z\\\",\\n            \\\"id\\\": \\\"v2.0\\\",\\n            \\\"links\\\": [\\n                {\\n                    \\\"href\\\": \\\"http://127.0.0.1:8774/v2/\\\",\\n                    \\\"rel\\\": \\\"self\\\"\\n                }\\n            ]\\n        },\\n        {\\n            \\\"status\\\": \\\"EXPERIMENTAL\\\",\\n            \\\"updated\\\": \\\"2013-07-23T11:33:21Z\\\",\\n            \\\"id\\\": \\\"v3.0\\\",\\n            \\\"links\\\": [\\n                {\\n                    \\\"href\\\": \\\"http://127.0.0.1:8774/v3/\\\",\\n                    \\\"rel\\\": \\\"self\\\"\\n                }\\n            ]\\n        }\\n    ]\\n}\"\n            }\n          }\n        }\n      }\n    },\n    \"/v2\": {\n      \"get\": {\n        \"operationId\": \"getVersionDetailsv2\",\n        \"summary\": \"Show API version details\",\n        \"produces\": [\n          \"application/json\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"200 203 response\",\n            \"examples\": {\n              \"application/json\": \"{\\n    \\\"version\\\": {\\n        \\\"status\\\": \\\"CURRENT\\\",\\n        \\\"updated\\\": \\\"2011-01-21T11:33:21Z\\\",\\n        \\\"media-types\\\": [\\n            {\\n                \\\"base\\\": \\\"application/xml\\\",\\n                \\\"type\\\": \\\"application/vnd.openstack.compute+xml;version=2\\\"\\n            },\\n            {\\n                \\\"base\\\": \\\"application/json\\\",\\n                \\\"type\\\": \\\"application/vnd.openstack.compute+json;version=2\\\"\\n            }\\n        ],\\n        \\\"id\\\": \\\"v2.0\\\",\\n        \\\"links\\\": [\\n            {\\n                \\\"href\\\": \\\"http://127.0.0.1:8774/v2/\\\",\\n                \\\"rel\\\": \\\"self\\\"\\n            },\\n            {\\n                \\\"href\\\": \\\"http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf\\\",\\n                \\\"type\\\": \\\"application/pdf\\\",\\n                \\\"rel\\\": \\\"describedby\\\"\\n            },\\n            {\\n                \\\"href\\\": \\\"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\\\",\\n                \\\"type\\\": \\\"application/vnd.sun.wadl+xml\\\",\\n                \\\"rel\\\": \\\"describedby\\\"\\n            },\\n            {\\n              \\\"href\\\": \\\"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\\\",\\n              \\\"type\\\": \\\"application/vnd.sun.wadl+xml\\\",\\n              \\\"rel\\\": \\\"describedby\\\"\\n            }\\n        ]\\n    }\\n}\"\n            }\n          },\n          \"203\": {\n            \"description\": \"200 203 response\",\n            \"examples\": {\n              \"application/json\": \"{\\n    \\\"version\\\": {\\n        \\\"status\\\": \\\"CURRENT\\\",\\n        \\\"updated\\\": \\\"2011-01-21T11:33:21Z\\\",\\n        \\\"media-types\\\": [\\n            {\\n                \\\"base\\\": \\\"application/xml\\\",\\n                \\\"type\\\": \\\"application/vnd.openstack.compute+xml;version=2\\\"\\n            },\\n            {\\n                \\\"base\\\": \\\"application/json\\\",\\n                \\\"type\\\": \\\"application/vnd.openstack.compute+json;version=2\\\"\\n            }\\n        ],\\n        \\\"id\\\": \\\"v2.0\\\",\\n        \\\"links\\\": [\\n            {\\n                \\\"href\\\": \\\"http://23.253.228.211:8774/v2/\\\",\\n                \\\"rel\\\": \\\"self\\\"\\n            },\\n            {\\n                \\\"href\\\": \\\"http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf\\\",\\n                \\\"type\\\": \\\"application/pdf\\\",\\n                \\\"rel\\\": \\\"describedby\\\"\\n            },\\n            {\\n                \\\"href\\\": \\\"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\\\",\\n                \\\"type\\\": \\\"application/vnd.sun.wadl+xml\\\",\\n                \\\"rel\\\": \\\"describedby\\\"\\n            }\\n        ]\\n    }\\n}\"\n            }\n          }\n        }\n      }\n    }\n  },\n  \"consumes\": [\n    \"application/json\"\n  ]\n}"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/json/petstore-expanded.json",
    "content": "{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"version\": \"1.0.0\",\n    \"title\": \"Swagger Petstore\",\n    \"description\": \"A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\",\n    \"termsOfService\": \"http://swagger.io/terms/\",\n    \"contact\": {\n      \"name\": \"Swagger API Team\",\n      \"email\": \"apiteam@swagger.io\",\n      \"url\": \"http://swagger.io\"\n    },\n    \"license\": {\n      \"name\": \"Apache 2.0\",\n      \"url\": \"https://www.apache.org/licenses/LICENSE-2.0.html\"\n    }\n  },\n  \"host\": \"petstore.swagger.io\",\n  \"basePath\": \"/api\",\n  \"schemes\": [\n    \"http\"\n  ],\n  \"consumes\": [\n    \"application/json\"\n  ],\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/pets\": {\n      \"get\": {\n        \"description\": \"Returns all pets from the system that the user has access to\\nNam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.\\n\\nSed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.\\n\",\n        \"operationId\": \"findPets\",\n        \"parameters\": [\n          {\n            \"name\": \"tags\",\n            \"in\": \"query\",\n            \"description\": \"tags to filter by\",\n            \"required\": false,\n            \"type\": \"array\",\n            \"collectionFormat\": \"csv\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"limit\",\n            \"in\": \"query\",\n            \"description\": \"maximum number of results to return\",\n            \"required\": false,\n            \"type\": \"integer\",\n            \"format\": \"int32\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"$ref\": \"#/definitions/Pet\"\n              }\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Error\"\n            }\n          }\n        }\n      },\n      \"post\": {\n        \"description\": \"Creates a new pet in the store.  Duplicates are allowed\",\n        \"operationId\": \"addPet\",\n        \"parameters\": [\n          {\n            \"name\": \"pet\",\n            \"in\": \"body\",\n            \"description\": \"Pet to add to the store\",\n            \"required\": true,\n            \"schema\": {\n              \"$ref\": \"#/definitions/NewPet\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pet\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Error\"\n            }\n          }\n        }\n      }\n    },\n    \"/pets/{id}\": {\n      \"get\": {\n        \"description\": \"Returns a user based on a single ID, if the user does not have access to the pet\",\n        \"operationId\": \"find pet by id\",\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to fetch\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pet\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Error\"\n            }\n          }\n        }\n      },\n      \"delete\": {\n        \"description\": \"deletes a single pet based on the ID supplied\",\n        \"operationId\": \"deletePet\",\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to delete\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"pet deleted\"\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Error\"\n            }\n          }\n        }\n      }\n    }\n  },\n  \"definitions\": {\n    \"Pet\": {\n      \"type\": \"object\",\n      \"allOf\": [\n        {\n          \"$ref\": \"#/definitions/NewPet\"\n        },\n        {\n          \"required\": [\n            \"id\"\n          ],\n          \"properties\": {\n            \"id\": {\n              \"type\": \"integer\",\n              \"format\": \"int64\"\n            }\n          }\n        }\n      ]\n    },\n    \"NewPet\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"name\"\n      ],\n      \"properties\": {\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"tag\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"Error\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"code\",\n        \"message\"\n      ],\n      \"properties\": {\n        \"code\": {\n          \"type\": \"integer\",\n          \"format\": \"int32\"\n        },\n        \"message\": {\n          \"type\": \"string\"\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/json/petstore-minimal.json",
    "content": "{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"version\": \"1.0.0\",\n    \"title\": \"Swagger Petstore\",\n    \"description\": \"A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\",\n    \"termsOfService\": \"http://swagger.io/terms/\",\n    \"contact\": {\n      \"name\": \"Swagger API Team\"\n    },\n    \"license\": {\n      \"name\": \"MIT\"\n    }\n  },\n  \"host\": \"petstore.swagger.io\",\n  \"basePath\": \"/api\",\n  \"schemes\": [\n    \"http\"\n  ],\n  \"consumes\": [\n    \"application/json\"\n  ],\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/pets\": {\n      \"get\": {\n        \"description\": \"Returns all pets from the system that the user has access to\",\n        \"produces\": [\n          \"application/json\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"A list of pets.\",\n            \"schema\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"$ref\": \"#/definitions/Pet\"\n              }\n            }\n          }\n        }\n      }\n    }\n  },\n  \"definitions\": {\n    \"Pet\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"id\",\n        \"name\"\n      ],\n      \"properties\": {\n        \"id\": {\n          \"type\": \"integer\",\n          \"format\": \"int64\"\n        },\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"tag\": {\n          \"type\": \"string\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/json/petstore-separate/common/Error.json",
    "content": "{\n  \"type\": \"object\",\n  \"required\": [\n    \"code\",\n    \"message\"\n  ],\n  \"properties\": {\n    \"code\": {\n      \"type\": \"integer\",\n      \"format\": \"int32\"\n    },\n    \"message\": {\n      \"type\": \"string\"\n    }\n  }\n}"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/json/petstore-separate/spec/NewPet.json",
    "content": "{\n  \"type\": \"object\",\n  \"allOf\": [\n    {\n      \"$ref\": \"Pet.json\"\n    },\n    {\n      \"required\": [\n        \"name\"\n      ],\n      \"properties\": {\n        \"description\": {\n          \"type\": \"integer\",\n          \"format\": \"int64\"\n        }\n      }\n    }\n  ]\n}"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/json/petstore-separate/spec/Pet.json",
    "content": "{\n  \"type\": \"object\",\n  \"required\": [\n    \"id\",\n    \"name\"\n  ],\n  \"properties\": {\n    \"id\": {\n      \"type\": \"integer\",\n      \"format\": \"int64\"\n    },\n    \"name\": {\n      \"type\": \"string\"\n    },\n    \"tag\": {\n      \"type\": \"string\"\n    }\n  }\n}"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/json/petstore-separate/spec/parameters.json",
    "content": "{\n  \"tagsParam\": {\n    \"name\": \"tags\",\n    \"in\": \"query\",\n    \"description\": \"tags to filter by\",\n    \"required\": false,\n    \"type\": \"array\",\n    \"collectionFormat\": \"csv\",\n    \"items\": {\n      \"type\": \"string\"\n    }\n  },\n  \"limitsParam\": {\n    \"name\": \"limit\",\n    \"in\": \"query\",\n    \"description\": \"maximum number of results to return\",\n    \"required\": false,\n    \"type\": \"integer\",\n    \"format\": \"int32\"\n  }\n}"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/json/petstore-separate/spec/swagger.json",
    "content": "{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"version\": \"1.0.0\",\n    \"title\": \"Swagger Petstore\",\n    \"description\": \"A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\",\n    \"termsOfService\": \"http://swagger.io/terms/\",\n    \"contact\": {\n      \"name\": \"Swagger API Team\",\n      \"email\": \"apiteam@swagger.io\",\n      \"url\": \"http://swagger.io\"\n    },\n    \"license\": {\n      \"name\": \"Apache 2.0\",\n      \"url\": \"https://www.apache.org/licenses/LICENSE-2.0.html\"\n    }\n  },\n  \"host\": \"petstore.swagger.io\",\n  \"basePath\": \"/api\",\n  \"schemes\": [\n    \"http\"\n  ],\n  \"consumes\": [\n    \"application/json\"\n  ],\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/pets\": {\n      \"get\": {\n        \"description\": \"Returns all pets from the system that the user has access to\\nNam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.\\n\\nSed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.\\n\",\n        \"operationId\": \"findPets\",\n        \"parameters\": [\n          {\n            \"$ref\": \"parameters.json#/tagsParam\"\n          },\n          {\n            \"$ref\": \"parameters.json#/limitsParam\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"$ref\": \"Pet.json\"\n              }\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"../common/Error.json\"\n            }\n          }\n        }\n      },\n      \"post\": {\n        \"description\": \"Creates a new pet in the store.  Duplicates are allowed\",\n        \"operationId\": \"addPet\",\n        \"parameters\": [\n          {\n            \"name\": \"pet\",\n            \"in\": \"body\",\n            \"description\": \"Pet to add to the store\",\n            \"required\": true,\n            \"schema\": {\n              \"$ref\": \"NewPet.json\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"Pet.json\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"../common/Error.json\"\n            }\n          }\n        }\n      }\n    },\n    \"/pets/{id}\": {\n      \"get\": {\n        \"description\": \"Returns a user based on a single ID, if the user does not have access to the pet\",\n        \"operationId\": \"find pet by id\",\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to fetch\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"Pet.json\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"../common/Error.json\"\n            }\n          }\n        }\n      },\n      \"delete\": {\n        \"description\": \"deletes a single pet based on the ID supplied\",\n        \"operationId\": \"deletePet\",\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to delete\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"pet deleted\"\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"../common/Error.json\"\n            }\n          }\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/json/petstore-simple.json",
    "content": "{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"version\": \"1.0.0\",\n    \"title\": \"Swagger Petstore\",\n    \"description\": \"A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\",\n    \"termsOfService\": \"http://swagger.io/terms/\",\n    \"contact\": {\n      \"name\": \"Swagger API Team\"\n    },\n    \"license\": {\n      \"name\": \"MIT\"\n    }\n  },\n  \"host\": \"petstore.swagger.io\",\n  \"basePath\": \"/api\",\n  \"schemes\": [\n    \"http\"\n  ],\n  \"consumes\": [\n    \"application/json\"\n  ],\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/pets\": {\n      \"get\": {\n        \"description\": \"Returns all pets from the system that the user has access to\",\n        \"operationId\": \"findPets\",\n        \"produces\": [\n          \"application/json\",\n          \"application/xml\",\n          \"text/xml\",\n          \"text/html\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"tags\",\n            \"in\": \"query\",\n            \"description\": \"tags to filter by\",\n            \"required\": false,\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"collectionFormat\": \"csv\"\n          },\n          {\n            \"name\": \"limit\",\n            \"in\": \"query\",\n            \"description\": \"maximum number of results to return\",\n            \"required\": false,\n            \"type\": \"integer\",\n            \"format\": \"int32\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"$ref\": \"#/definitions/Pet\"\n              }\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      },\n      \"post\": {\n        \"description\": \"Creates a new pet in the store.  Duplicates are allowed\",\n        \"operationId\": \"addPet\",\n        \"produces\": [\n          \"application/json\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"pet\",\n            \"in\": \"body\",\n            \"description\": \"Pet to add to the store\",\n            \"required\": true,\n            \"schema\": {\n              \"$ref\": \"#/definitions/NewPet\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pet\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      }\n    },\n    \"/pets/{id}\": {\n      \"get\": {\n        \"description\": \"Returns a user based on a single ID, if the user does not have access to the pet\",\n        \"operationId\": \"findPetById\",\n        \"produces\": [\n          \"application/json\",\n          \"application/xml\",\n          \"text/xml\",\n          \"text/html\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to fetch\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pet\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      },\n      \"delete\": {\n        \"description\": \"deletes a single pet based on the ID supplied\",\n        \"operationId\": \"deletePet\",\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to delete\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"pet deleted\"\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      }\n    }\n  },\n  \"definitions\": {\n    \"Pet\": {\n      \"type\": \"object\",\n      \"allOf\": [\n        {\n          \"$ref\": \"#/definitions/NewPet\"\n        },\n        {\n          \"required\": [\n            \"id\"\n          ],\n          \"properties\": {\n            \"id\": {\n              \"type\": \"integer\",\n              \"format\": \"int64\"\n            }\n          }\n        }\n      ]\n    },\n    \"NewPet\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"name\"\n      ],\n      \"properties\": {\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"tag\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"ErrorModel\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"code\",\n        \"message\"\n      ],\n      \"properties\": {\n        \"code\": {\n          \"type\": \"integer\",\n          \"format\": \"int32\"\n        },\n        \"message\": {\n          \"type\": \"string\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/json/petstore-with-external-docs.json",
    "content": "{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"version\": \"1.0.0\",\n    \"title\": \"Swagger Petstore\",\n    \"description\": \"A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\",\n    \"termsOfService\": \"http://swagger.io/terms/\",\n    \"contact\": {\n      \"name\": \"Swagger API Team\",\n      \"email\": \"apiteam@swagger.io\",\n      \"url\": \"http://swagger.io\"\n    },\n    \"license\": {\n      \"name\": \"Apache 2.0\",\n      \"url\": \"https://www.apache.org/licenses/LICENSE-2.0.html\"\n    }\n  },\n  \"externalDocs\": {\n    \"description\": \"find more info here\",\n    \"url\": \"https://swagger.io/about\"\n  },\n  \"host\": \"petstore.swagger.io\",\n  \"basePath\": \"/api\",\n  \"schemes\": [\n    \"http\"\n  ],\n  \"consumes\": [\n    \"application/json\"\n  ],\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/pets\": {\n      \"get\": {\n        \"description\": \"Returns all pets from the system that the user has access to\",\n        \"operationId\": \"findPets\",\n        \"externalDocs\": {\n          \"description\": \"find more info here\",\n          \"url\": \"https://swagger.io/about\"\n        },\n        \"produces\": [\n          \"application/json\",\n          \"application/xml\",\n          \"text/xml\",\n          \"text/html\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"tags\",\n            \"in\": \"query\",\n            \"description\": \"tags to filter by\",\n            \"required\": false,\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"collectionFormat\": \"csv\"\n          },\n          {\n            \"name\": \"limit\",\n            \"in\": \"query\",\n            \"description\": \"maximum number of results to return\",\n            \"required\": false,\n            \"type\": \"integer\",\n            \"format\": \"int32\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"$ref\": \"#/definitions/Pet\"\n              }\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      },\n      \"post\": {\n        \"description\": \"Creates a new pet in the store.  Duplicates are allowed\",\n        \"operationId\": \"addPet\",\n        \"produces\": [\n          \"application/json\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"pet\",\n            \"in\": \"body\",\n            \"description\": \"Pet to add to the store\",\n            \"required\": true,\n            \"schema\": {\n              \"$ref\": \"#/definitions/NewPet\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pet\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      }\n    },\n    \"/pets/{id}\": {\n      \"get\": {\n        \"description\": \"Returns a user based on a single ID, if the user does not have access to the pet\",\n        \"operationId\": \"findPetById\",\n        \"produces\": [\n          \"application/json\",\n          \"application/xml\",\n          \"text/xml\",\n          \"text/html\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to fetch\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pet\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      },\n      \"delete\": {\n        \"description\": \"deletes a single pet based on the ID supplied\",\n        \"operationId\": \"deletePet\",\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to delete\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"pet deleted\"\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      }\n    }\n  },\n  \"definitions\": {\n    \"Pet\": {\n      \"type\": \"object\",\n      \"allOf\": [\n        {\n          \"$ref\": \"#/definitions/NewPet\"\n        },\n        {\n          \"required\": [\n            \"id\"\n          ],\n          \"properties\": {\n            \"id\": {\n              \"type\": \"integer\",\n              \"format\": \"int64\"\n            }\n          }\n        }\n      ]\n    },\n    \"NewPet\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"name\"\n      ],\n      \"properties\": {\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"tag\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"ErrorModel\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"code\",\n        \"message\"\n      ],\n      \"properties\": {\n        \"code\": {\n          \"type\": \"integer\",\n          \"format\": \"int32\"\n        },\n        \"message\": {\n          \"type\": \"string\"\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/json/petstore.json",
    "content": "{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"version\": \"1.0.0\",\n    \"title\": \"Swagger Petstore\",\n    \"license\": {\n      \"name\": \"MIT\"\n    }\n  },\n  \"host\": \"petstore.swagger.io\",\n  \"basePath\": \"/v1\",\n  \"schemes\": [\n    \"http\"\n  ],\n  \"consumes\": [\n    \"application/json\"\n  ],\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/pets\": {\n      \"get\": {\n        \"summary\": \"List all pets\",\n        \"operationId\": \"listPets\",\n        \"tags\": [\n          \"pets\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"limit\",\n            \"in\": \"query\",\n            \"description\": \"How many items to return at one time (max 100)\",\n            \"required\": false,\n            \"type\": \"integer\",\n            \"format\": \"int32\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"An paged array of pets\",\n            \"headers\": {\n              \"x-next\": {\n                \"type\": \"string\",\n                \"description\": \"A link to the next page of responses\"\n              }\n            },\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pets\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Error\"\n            }\n          }\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a pet\",\n        \"operationId\": \"createPets\",\n        \"tags\": [\n          \"pets\"\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Null response\"\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Error\"\n            }\n          }\n        }\n      }\n    },\n    \"/pets/{petId}\": {\n      \"get\": {\n        \"summary\": \"Info for a specific pet\",\n        \"operationId\": \"showPetById\",\n        \"tags\": [\n          \"pets\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"petId\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"description\": \"The id of the pet to retrieve\",\n            \"type\": \"string\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Expected response to a valid request\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pets\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Error\"\n            }\n          }\n        }\n      }\n    }\n  },\n  \"definitions\": {\n    \"Pet\": {\n      \"required\": [\n        \"id\",\n        \"name\"\n      ],\n      \"properties\": {\n        \"id\": {\n          \"type\": \"integer\",\n          \"format\": \"int64\"\n        },\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"tag\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"Pets\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"$ref\": \"#/definitions/Pet\"\n      }\n    },\n    \"Error\": {\n      \"required\": [\n        \"code\",\n        \"message\"\n      ],\n      \"properties\": {\n        \"code\": {\n          \"type\": \"integer\",\n          \"format\": \"int32\"\n        },\n        \"message\": {\n          \"type\": \"string\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/json/uber.json",
    "content": "{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"title\": \"Uber API\",\n    \"description\": \"Move your app forward with the Uber API\",\n    \"version\": \"1.0.0\"\n  },\n  \"host\": \"api.uber.com\",\n  \"schemes\": [\n    \"https\"\n  ],\n  \"basePath\": \"/v1\",\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/products\": {\n      \"get\": {\n        \"summary\": \"Product Types\",\n        \"description\": \"The Products endpoint returns information about the Uber products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order.\",\n        \"parameters\": [\n          {\n            \"name\": \"latitude\",\n            \"in\": \"query\",\n            \"description\": \"Latitude component of location.\",\n            \"required\": true,\n            \"type\": \"number\",\n            \"format\": \"double\"\n          },\n          {\n            \"name\": \"longitude\",\n            \"in\": \"query\",\n            \"description\": \"Longitude component of location.\",\n            \"required\": true,\n            \"type\": \"number\",\n            \"format\": \"double\"\n          }\n        ],\n        \"tags\": [\n          \"Products\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"An array of products\",\n            \"schema\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"$ref\": \"#/definitions/Product\"\n              }\n            }\n          },\n          \"default\": {\n            \"description\": \"Unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Error\"\n            }\n          }\n        }\n      }\n    },\n    \"/estimates/price\": {\n      \"get\": {\n        \"summary\": \"Price Estimates\",\n        \"description\": \"The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.<br><br>The response also includes low and high estimates, and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.\",\n        \"parameters\": [\n          {\n            \"name\": \"start_latitude\",\n            \"in\": \"query\",\n            \"description\": \"Latitude component of start location.\",\n            \"required\": true,\n            \"type\": \"number\",\n            \"format\": \"double\"\n          },\n          {\n            \"name\": \"start_longitude\",\n            \"in\": \"query\",\n            \"description\": \"Longitude component of start location.\",\n            \"required\": true,\n            \"type\": \"number\",\n            \"format\": \"double\"\n          },\n          {\n            \"name\": \"end_latitude\",\n            \"in\": \"query\",\n            \"description\": \"Latitude component of end location.\",\n            \"required\": true,\n            \"type\": \"number\",\n            \"format\": \"double\"\n          },\n          {\n            \"name\": \"end_longitude\",\n            \"in\": \"query\",\n            \"description\": \"Longitude component of end location.\",\n            \"required\": true,\n            \"type\": \"number\",\n            \"format\": \"double\"\n          }\n        ],\n        \"tags\": [\n          \"Estimates\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"An array of price estimates by product\",\n            \"schema\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"$ref\": \"#/definitions/PriceEstimate\"\n              }\n            }\n          },\n          \"default\": {\n            \"description\": \"Unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Error\"\n            }\n          }\n        }\n      }\n    },\n    \"/estimates/time\": {\n      \"get\": {\n        \"summary\": \"Time Estimates\",\n        \"description\": \"The Time Estimates endpoint returns ETAs for all products offered at a given location, with the responses expressed as integers in seconds. We recommend that this endpoint be called every minute to provide the most accurate, up-to-date ETAs.\",\n        \"parameters\": [\n          {\n            \"name\": \"start_latitude\",\n            \"in\": \"query\",\n            \"description\": \"Latitude component of start location.\",\n            \"required\": true,\n            \"type\": \"number\",\n            \"format\": \"double\"\n          },\n          {\n            \"name\": \"start_longitude\",\n            \"in\": \"query\",\n            \"description\": \"Longitude component of start location.\",\n            \"required\": true,\n            \"type\": \"number\",\n            \"format\": \"double\"\n          },\n          {\n            \"name\": \"customer_uuid\",\n            \"in\": \"query\",\n            \"type\": \"string\",\n            \"format\": \"uuid\",\n            \"description\": \"Unique customer identifier to be used for experience customization.\"\n          },\n          {\n            \"name\": \"product_id\",\n            \"in\": \"query\",\n            \"type\": \"string\",\n            \"description\": \"Unique identifier representing a specific product for a given latitude & longitude.\"\n          }\n        ],\n        \"tags\": [\n          \"Estimates\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"An array of products\",\n            \"schema\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"$ref\": \"#/definitions/Product\"\n              }\n            }\n          },\n          \"default\": {\n            \"description\": \"Unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Error\"\n            }\n          }\n        }\n      }\n    },\n    \"/me\": {\n      \"get\": {\n        \"summary\": \"User Profile\",\n        \"description\": \"The User Profile endpoint returns information about the Uber user that has authorized with the application.\",\n        \"tags\": [\n          \"User\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Profile information for a user\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Profile\"\n            }\n          },\n          \"default\": {\n            \"description\": \"Unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Error\"\n            }\n          }\n        }\n      }\n    },\n    \"/history\": {\n      \"get\": {\n        \"summary\": \"User Activity\",\n        \"description\": \"The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.<br><br>The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.\",\n        \"parameters\": [\n          {\n            \"name\": \"offset\",\n            \"in\": \"query\",\n            \"type\": \"integer\",\n            \"format\": \"int32\",\n            \"description\": \"Offset the list of returned results by this amount. Default is zero.\"\n          },\n          {\n            \"name\": \"limit\",\n            \"in\": \"query\",\n            \"type\": \"integer\",\n            \"format\": \"int32\",\n            \"description\": \"Number of items to retrieve. Default is 5, maximum is 100.\"\n          }\n        ],\n        \"tags\": [\n          \"User\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"History information for the given user\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Activities\"\n            }\n          },\n          \"default\": {\n            \"description\": \"Unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Error\"\n            }\n          }\n        }\n      }\n    }\n  },\n  \"definitions\": {\n    \"Product\": {\n      \"properties\": {\n        \"product_id\": {\n          \"type\": \"string\",\n          \"description\": \"Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles.\"\n        },\n        \"description\": {\n          \"type\": \"string\",\n          \"description\": \"Description of product.\"\n        },\n        \"display_name\": {\n          \"type\": \"string\",\n          \"description\": \"Display name of product.\"\n        },\n        \"capacity\": {\n          \"type\": \"string\",\n          \"description\": \"Capacity of product. For example, 4 people.\"\n        },\n        \"image\": {\n          \"type\": \"string\",\n          \"description\": \"Image URL representing the product.\"\n        }\n      }\n    },\n    \"PriceEstimate\": {\n      \"properties\": {\n        \"product_id\": {\n          \"type\": \"string\",\n          \"description\": \"Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles\"\n        },\n        \"currency_code\": {\n          \"type\": \"string\",\n          \"description\": \"[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code.\"\n        },\n        \"display_name\": {\n          \"type\": \"string\",\n          \"description\": \"Display name of product.\"\n        },\n        \"estimate\": {\n          \"type\": \"string\",\n          \"description\": \"Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or \\\"Metered\\\" for TAXI.\"\n        },\n        \"low_estimate\": {\n          \"type\": \"number\",\n          \"description\": \"Lower bound of the estimated price.\"\n        },\n        \"high_estimate\": {\n          \"type\": \"number\",\n          \"description\": \"Upper bound of the estimated price.\"\n        },\n        \"surge_multiplier\": {\n          \"type\": \"number\",\n          \"description\": \"Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier.\"\n        }\n      }\n    },\n    \"Profile\": {\n      \"properties\": {\n        \"first_name\": {\n          \"type\": \"string\",\n          \"description\": \"First name of the Uber user.\"\n        },\n        \"last_name\": {\n          \"type\": \"string\",\n          \"description\": \"Last name of the Uber user.\"\n        },\n        \"email\": {\n          \"type\": \"string\",\n          \"description\": \"Email address of the Uber user\"\n        },\n        \"picture\": {\n          \"type\": \"string\",\n          \"description\": \"Image URL of the Uber user.\"\n        },\n        \"promo_code\": {\n          \"type\": \"string\",\n          \"description\": \"Promo code of the Uber user.\"\n        }\n      }\n    },\n    \"Activity\": {\n      \"properties\": {\n        \"uuid\": {\n          \"type\": \"string\",\n          \"description\": \"Unique identifier for the activity\"\n        }\n      }\n    },\n    \"Activities\": {\n      \"properties\": {\n        \"offset\": {\n          \"type\": \"integer\",\n          \"format\": \"int32\",\n          \"description\": \"Position in pagination.\"\n        },\n        \"limit\": {\n          \"type\": \"integer\",\n          \"format\": \"int32\",\n          \"description\": \"Number of items to retrieve (100 max).\"\n        },\n        \"count\": {\n          \"type\": \"integer\",\n          \"format\": \"int32\",\n          \"description\": \"Total number of items available.\"\n        },\n        \"history\": {\n          \"type\": \"array\",\n          \"items\": {\n              \"$ref\": \"#/definitions/Activity\"\n           }\n        }\n      }\n    },\n    \"Error\": {\n      \"properties\": {\n        \"code\": {\n          \"type\": \"integer\",\n          \"format\": \"int32\"\n        },\n        \"message\": {\n          \"type\": \"string\"\n        },\n        \"fields\": {\n          \"type\": \"string\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/yaml/api-with-examples.yaml",
    "content": "swagger: \"2.0\"\ninfo:\n  title: Simple API overview\n  version: v2\npaths:\n  /:\n    get:\n      operationId: listVersionsv2\n      summary: List API versions\n      produces:\n      - application/json\n      responses:\n        \"200\":\n          description: |-\n            200 300 response\n          examples:\n            application/json: |-\n              {\n                  \"versions\": [\n                      {\n                          \"status\": \"CURRENT\",\n                          \"updated\": \"2011-01-21T11:33:21Z\",\n                          \"id\": \"v2.0\",\n                          \"links\": [\n                              {\n                                  \"href\": \"http://127.0.0.1:8774/v2/\",\n                                  \"rel\": \"self\"\n                              }\n                          ]\n                      },\n                      {\n                          \"status\": \"EXPERIMENTAL\",\n                          \"updated\": \"2013-07-23T11:33:21Z\",\n                          \"id\": \"v3.0\",\n                          \"links\": [\n                              {\n                                  \"href\": \"http://127.0.0.1:8774/v3/\",\n                                  \"rel\": \"self\"\n                              }\n                          ]\n                      }\n                  ]\n              }\n        \"300\":\n          description: |-\n            200 300 response\n          examples:\n            application/json: |-\n              {\n                  \"versions\": [\n                      {\n                          \"status\": \"CURRENT\",\n                          \"updated\": \"2011-01-21T11:33:21Z\",\n                          \"id\": \"v2.0\",\n                          \"links\": [\n                              {\n                                  \"href\": \"http://127.0.0.1:8774/v2/\",\n                                  \"rel\": \"self\"\n                              }\n                          ]\n                      },\n                      {\n                          \"status\": \"EXPERIMENTAL\",\n                          \"updated\": \"2013-07-23T11:33:21Z\",\n                          \"id\": \"v3.0\",\n                          \"links\": [\n                              {\n                                  \"href\": \"http://127.0.0.1:8774/v3/\",\n                                  \"rel\": \"self\"\n                              }\n                          ]\n                      }\n                  ]\n              }\n  /v2:\n    get:\n      operationId: getVersionDetailsv2\n      summary: Show API version details\n      produces:\n      - application/json\n      responses:\n        \"200\":\n          description: |-\n            200 203 response\n          examples:\n            application/json: |-\n              {\n                  \"version\": {\n                      \"status\": \"CURRENT\",\n                      \"updated\": \"2011-01-21T11:33:21Z\",\n                      \"media-types\": [\n                          {\n                              \"base\": \"application/xml\",\n                              \"type\": \"application/vnd.openstack.compute+xml;version=2\"\n                          },\n                          {\n                              \"base\": \"application/json\",\n                              \"type\": \"application/vnd.openstack.compute+json;version=2\"\n                          }\n                      ],\n                      \"id\": \"v2.0\",\n                      \"links\": [\n                          {\n                              \"href\": \"http://127.0.0.1:8774/v2/\",\n                              \"rel\": \"self\"\n                          },\n                          {\n                              \"href\": \"http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf\",\n                              \"type\": \"application/pdf\",\n                              \"rel\": \"describedby\"\n                          },\n                          {\n                              \"href\": \"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\",\n                              \"type\": \"application/vnd.sun.wadl+xml\",\n                              \"rel\": \"describedby\"\n                          },\n                          {\n                            \"href\": \"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\",\n                            \"type\": \"application/vnd.sun.wadl+xml\",\n                            \"rel\": \"describedby\"\n                          }\n                      ]\n                  }\n              }\n        \"203\":\n          description: |-\n            200 203 response\n          examples:\n            application/json: |-\n              {\n                  \"version\": {\n                      \"status\": \"CURRENT\",\n                      \"updated\": \"2011-01-21T11:33:21Z\",\n                      \"media-types\": [\n                          {\n                              \"base\": \"application/xml\",\n                              \"type\": \"application/vnd.openstack.compute+xml;version=2\"\n                          },\n                          {\n                              \"base\": \"application/json\",\n                              \"type\": \"application/vnd.openstack.compute+json;version=2\"\n                          }\n                      ],\n                      \"id\": \"v2.0\",\n                      \"links\": [\n                          {\n                              \"href\": \"http://23.253.228.211:8774/v2/\",\n                              \"rel\": \"self\"\n                          },\n                          {\n                              \"href\": \"http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf\",\n                              \"type\": \"application/pdf\",\n                              \"rel\": \"describedby\"\n                          },\n                          {\n                              \"href\": \"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\",\n                              \"type\": \"application/vnd.sun.wadl+xml\",\n                              \"rel\": \"describedby\"\n                          }\n                      ]\n                  }\n              }\nconsumes:\n- application/json\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/yaml/petstore-expanded.yaml",
    "content": "swagger: \"2.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  description: A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\n  termsOfService: http://swagger.io/terms/\n  contact:\n    name: Swagger API Team\n    email: apiteam@swagger.io\n    url: http://swagger.io\n  license:\n    name: Apache 2.0\n    url: https://www.apache.org/licenses/LICENSE-2.0.html\nhost: petstore.swagger.io\nbasePath: /api\nschemes:\n  - http\nconsumes:\n  - application/json\nproduces:\n  - application/json\npaths:\n  /pets:\n    get:\n      description: |\n        Returns all pets from the system that the user has access to\n      operationId: findPets\n      parameters:\n        - name: tags\n          in: query\n          description: tags to filter by\n          required: false\n          type: array\n          collectionFormat: csv\n          items:\n            type: string\n        - name: limit\n          in: query\n          description: maximum number of results to return\n          required: false\n          type: integer\n          format: int32\n      responses:\n        \"200\":\n          description: pet response\n          schema:\n            type: array\n            items:\n              $ref: '#/definitions/Pet'\n        default:\n          description: unexpected error\n          schema:\n            $ref: '#/definitions/Error'\n    post:\n      description: Creates a new pet in the store.  Duplicates are allowed\n      operationId: addPet\n      parameters:\n        - name: pet\n          in: body\n          description: Pet to add to the store\n          required: true\n          schema:\n            $ref: '#/definitions/NewPet'\n      responses:\n        \"200\":\n          description: pet response\n          schema:\n            $ref: '#/definitions/Pet'\n        default:\n          description: unexpected error\n          schema:\n            $ref: '#/definitions/Error'\n  /pets/{id}:\n    get:\n      description: Returns a user based on a single ID, if the user does not have access to the pet\n      operationId: find pet by id\n      parameters:\n        - name: id\n          in: path\n          description: ID of pet to fetch\n          required: true\n          type: integer\n          format: int64\n      responses:\n        \"200\":\n          description: pet response\n          schema:\n            $ref: '#/definitions/Pet'\n        default:\n          description: unexpected error\n          schema:\n            $ref: '#/definitions/Error'\n    delete:\n      description: deletes a single pet based on the ID supplied\n      operationId: deletePet\n      parameters:\n        - name: id\n          in: path\n          description: ID of pet to delete\n          required: true\n          type: integer\n          format: int64\n      responses:\n        \"204\":\n          description: pet deleted\n        default:\n          description: unexpected error\n          schema:\n            $ref: '#/definitions/Error'\ndefinitions:\n  Pet:\n    allOf:\n      - $ref: '#/definitions/NewPet'\n      - required:\n        - id\n        type: \"object\"\n        properties:\n          id:\n            type: integer\n            format: int64\n\n  NewPet:\n    type: \"object\"\n    required:\n      - name  \n    properties:\n      name:\n        type: string\n      tag:\n        type: string    \n\n  Error:\n    type: \"object\"\n    required:\n      - code\n      - message\n    properties:\n      code:\n        type: integer\n        format: int32\n      message:\n        type: string\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/yaml/petstore-minimal.yaml",
    "content": "---\n  swagger: \"2.0\"\n  info: \n    version: \"1.0.0\"\n    title: \"Swagger Petstore\"\n    description: \"A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\"\n    termsOfService: \"http://swagger.io/terms/\"\n    contact: \n      name: \"Swagger API Team\"\n    license: \n      name: \"MIT\"\n  host: \"petstore.swagger.io\"\n  basePath: \"/api\"\n  schemes: \n    - \"http\"\n  consumes: \n    - \"application/json\"\n  produces: \n    - \"application/json\"\n  paths: \n    /pets: \n      get: \n        description: \"Returns all pets from the system that the user has access to\"\n        produces: \n          - \"application/json\"\n        responses: \n          \"200\":\n            description: \"A list of pets.\"\n            schema: \n              type: \"array\"\n              items: \n                $ref: \"#/definitions/Pet\"\n  definitions: \n    Pet: \n      type: \"object\"\n      required: \n        - \"id\"\n        - \"name\"\n      properties: \n        id: \n          type: \"integer\"\n          format: \"int64\"\n        name: \n          type: \"string\"\n        tag: \n          type: \"string\"\n\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/yaml/petstore-separate/common/Error.yaml",
    "content": "type: object\nrequired:\n  - code\n  - message\nproperties:\n  code:\n    type: integer\n    format: int32\n  message:\n    type: string\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/yaml/petstore-separate/spec/NewPet.yaml",
    "content": "type: object\nallOf:\n  - $ref: 'Pet.yaml'\n  - required:\n      - name\n    properties:\n      description:\n        type: integer\n        format: int64\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/yaml/petstore-separate/spec/Pet.yaml",
    "content": "type: object\nrequired:\n  - id\n  - name\nproperties:\n  id:\n    type: integer\n    format: int64\n  name:\n    type: string\n  tag:\n    type: string\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/yaml/petstore-separate/spec/parameters.yaml",
    "content": "tagsParam:\n  name: tags\n  in: query\n  description: tags to filter by\n  required: false\n  type: array\n  collectionFormat: csv\n  items:\n    type: string\nlimitsParam:\n  name: limit\n  in: query\n  description: maximum number of results to return\n  required: false\n  type: integer\n  format: int32\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/yaml/petstore-separate/spec/swagger.yaml",
    "content": "swagger: \"2.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  description: A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\n  termsOfService: http://swagger.io/terms/\n  contact:\n    name: Swagger API Team\n    email: apiteam@swagger.io\n    url: http://swagger.io\n  license:\n    name: Apache 2.0\n    url: https://www.apache.org/licenses/LICENSE-2.0.html\nhost: petstore.swagger.io\nbasePath: /api\nschemes:\n  - http\nconsumes:\n  - application/json\nproduces:\n  - application/json\npaths:\n  /pets:\n    get:\n      description: |\n        Returns all pets from the system that the user has access to\n        Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.\n\n        Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.\n      operationId: findPets\n      parameters:\n        - $ref: 'parameters.yaml#/tagsParam'\n        - $ref: 'parameters.yaml#/limitsParam'\n      responses:\n        \"200\":\n          description: pet response\n          schema:\n            type: array\n            items:\n              $ref: 'Pet.yaml'\n        default:\n          description: unexpected error\n          schema:\n            $ref: '../common/Error.yaml'\n    post:\n      description: Creates a new pet in the store.  Duplicates are allowed\n      operationId: addPet\n      parameters:\n        - name: pet\n          in: body\n          description: Pet to add to the store\n          required: true\n          schema:\n            $ref: 'NewPet.yaml'\n      responses:\n        \"200\":\n          description: pet response\n          schema:\n            $ref: 'Pet.yaml'\n        default:\n          description: unexpected error\n          schema:\n            $ref: '../common/Error.yaml'\n  /pets/{id}:\n    get:\n      description: Returns a user based on a single ID, if the user does not have access to the pet\n      operationId: find pet by id\n      parameters:\n        - name: id\n          in: path\n          description: ID of pet to fetch\n          required: true\n          type: integer\n          format: int64\n      responses:\n        \"200\":\n          description: pet response\n          schema:\n            $ref: 'Pet.yaml'\n        default:\n          description: unexpected error\n          schema:\n            $ref: '../common/Error.yaml'\n    delete:\n      description: deletes a single pet based on the ID supplied\n      operationId: deletePet\n      parameters:\n        - name: id\n          in: path\n          description: ID of pet to delete\n          required: true\n          type: integer\n          format: int64\n      responses:\n        \"204\":\n          description: pet deleted\n        default:\n          description: unexpected error\n          schema:\n            $ref: '../common/Error.yaml'\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/yaml/petstore-simple.yaml",
    "content": "---\n  swagger: \"2.0\"\n  info: \n    version: \"1.0.0\"\n    title: \"Swagger Petstore\"\n    description: \"A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\"\n    termsOfService: \"http://swagger.io/terms/\"\n    contact: \n      name: \"Swagger API Team\"\n    license: \n      name: \"MIT\"\n  host: \"petstore.swagger.io\"\n  basePath: \"/api\"\n  schemes: \n    - \"http\"\n  consumes: \n    - \"application/json\"\n  produces: \n    - \"application/json\"\n  paths: \n    /pets: \n      get: \n        description: \"Returns all pets from the system that the user has access to\"\n        operationId: \"findPets\"\n        produces: \n          - \"application/json\"\n          - \"application/xml\"\n          - \"text/xml\"\n          - \"text/html\"\n        parameters: \n          - \n            name: \"tags\"\n            in: \"query\"\n            description: \"tags to filter by\"\n            required: false\n            type: \"array\"\n            items: \n              type: \"string\"\n            collectionFormat: \"csv\"\n          - \n            name: \"limit\"\n            in: \"query\"\n            description: \"maximum number of results to return\"\n            required: false\n            type: \"integer\"\n            format: \"int32\"\n        responses: \n          \"200\":\n            description: \"pet response\"\n            schema: \n              type: \"array\"\n              items: \n                $ref: \"#/definitions/Pet\"\n          default: \n            description: \"unexpected error\"\n            schema: \n              $ref: \"#/definitions/ErrorModel\"\n      post: \n        description: \"Creates a new pet in the store.  Duplicates are allowed\"\n        operationId: \"addPet\"\n        produces: \n          - \"application/json\"\n        parameters: \n          - \n            name: \"pet\"\n            in: \"body\"\n            description: \"Pet to add to the store\"\n            required: true\n            schema: \n              $ref: \"#/definitions/NewPet\"\n        responses: \n          \"200\":\n            description: \"pet response\"\n            schema: \n              $ref: \"#/definitions/Pet\"\n          default: \n            description: \"unexpected error\"\n            schema: \n              $ref: \"#/definitions/ErrorModel\"\n    /pets/{id}: \n      get: \n        description: \"Returns a user based on a single ID, if the user does not have access to the pet\"\n        operationId: \"findPetById\"\n        produces: \n          - \"application/json\"\n          - \"application/xml\"\n          - \"text/xml\"\n          - \"text/html\"\n        parameters: \n          - \n            name: \"id\"\n            in: \"path\"\n            description: \"ID of pet to fetch\"\n            required: true\n            type: \"integer\"\n            format: \"int64\"\n        responses: \n          \"200\":\n            description: \"pet response\"\n            schema: \n              $ref: \"#/definitions/Pet\"\n          default: \n            description: \"unexpected error\"\n            schema: \n              $ref: \"#/definitions/ErrorModel\"\n      delete: \n        description: \"deletes a single pet based on the ID supplied\"\n        operationId: \"deletePet\"\n        parameters: \n          - \n            name: \"id\"\n            in: \"path\"\n            description: \"ID of pet to delete\"\n            required: true\n            type: \"integer\"\n            format: \"int64\"\n        responses: \n          \"204\":\n            description: \"pet deleted\"\n          default: \n            description: \"unexpected error\"\n            schema: \n              $ref: \"#/definitions/ErrorModel\"\n  definitions: \n    Pet: \n      type: \"object\"\n      allOf: \n        - \n          $ref: \"#/definitions/NewPet\"\n        - \n          required: \n            - \"id\"\n          properties: \n            id: \n              type: \"integer\"\n              format: \"int64\"\n    NewPet: \n      type: \"object\"\n      required: \n        - \"name\"\n      properties: \n        name: \n          type: \"string\"\n        tag: \n          type: \"string\"\n    ErrorModel: \n      type: \"object\"\n      required: \n        - \"code\"\n        - \"message\"\n      properties: \n        code: \n          type: \"integer\"\n          format: \"int32\"\n        message: \n          type: \"string\"\n\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/yaml/petstore-with-external-docs.yaml",
    "content": "---\n  swagger: \"2.0\"\n  info: \n    version: \"1.0.0\"\n    title: \"Swagger Petstore\"\n    description: \"A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\"\n    termsOfService: \"http://swagger.io/terms/\"\n    contact: \n      name: \"Swagger API Team\"\n      email: \"apiteam@swagger.io\"\n      url: \"http://swagger.io\"\n    license: \n      name: \"Apache 2.0\"\n      url: \"https://www.apache.org/licenses/LICENSE-2.0.html\"\n  externalDocs: \n    description: \"find more info here\"\n    url: \"https://swagger.io/about\"\n  host: \"petstore.swagger.io\"\n  basePath: \"/api\"\n  schemes: \n    - \"http\"\n  consumes: \n    - \"application/json\"\n  produces: \n    - \"application/json\"\n  paths: \n    /pets: \n      get: \n        description: \"Returns all pets from the system that the user has access to\"\n        operationId: \"findPets\"\n        externalDocs: \n          description: \"find more info here\"\n          url: \"https://swagger.io/about\"\n        produces: \n          - \"application/json\"\n          - \"application/xml\"\n          - \"text/xml\"\n          - \"text/html\"\n        parameters: \n          - \n            name: \"tags\"\n            in: \"query\"\n            description: \"tags to filter by\"\n            required: false\n            type: \"array\"\n            items: \n              type: \"string\"\n            collectionFormat: \"csv\"\n          - \n            name: \"limit\"\n            in: \"query\"\n            description: \"maximum number of results to return\"\n            required: false\n            type: \"integer\"\n            format: \"int32\"\n        responses: \n          \"200\":\n            description: \"pet response\"\n            schema: \n              type: \"array\"\n              items: \n                $ref: \"#/definitions/Pet\"\n          default: \n            description: \"unexpected error\"\n            schema: \n              $ref: \"#/definitions/ErrorModel\"\n      post: \n        description: \"Creates a new pet in the store.  Duplicates are allowed\"\n        operationId: \"addPet\"\n        produces: \n          - \"application/json\"\n        parameters: \n          - \n            name: \"pet\"\n            in: \"body\"\n            description: \"Pet to add to the store\"\n            required: true\n            schema: \n              $ref: \"#/definitions/NewPet\"\n        responses: \n          \"200\":\n            description: \"pet response\"\n            schema: \n              $ref: \"#/definitions/Pet\"\n          default: \n            description: \"unexpected error\"\n            schema: \n              $ref: \"#/definitions/ErrorModel\"\n    /pets/{id}: \n      get: \n        description: \"Returns a user based on a single ID, if the user does not have access to the pet\"\n        operationId: \"findPetById\"\n        produces: \n          - \"application/json\"\n          - \"application/xml\"\n          - \"text/xml\"\n          - \"text/html\"\n        parameters: \n          - \n            name: \"id\"\n            in: \"path\"\n            description: \"ID of pet to fetch\"\n            required: true\n            type: \"integer\"\n            format: \"int64\"\n        responses: \n          \"200\":\n            description: \"pet response\"\n            schema: \n              $ref: \"#/definitions/Pet\"\n          default: \n            description: \"unexpected error\"\n            schema: \n              $ref: \"#/definitions/ErrorModel\"\n      delete: \n        description: \"deletes a single pet based on the ID supplied\"\n        operationId: \"deletePet\"\n        parameters: \n          - \n            name: \"id\"\n            in: \"path\"\n            description: \"ID of pet to delete\"\n            required: true\n            type: \"integer\"\n            format: \"int64\"\n        responses: \n          \"204\":\n            description: \"pet deleted\"\n          default: \n            description: \"unexpected error\"\n            schema: \n              $ref: \"#/definitions/ErrorModel\"\n  definitions: \n    Pet: \n      type: \"object\"\n      allOf: \n        - \n          $ref: \"#/definitions/NewPet\"\n        - \n          required: \n            - \"id\"\n          properties: \n            id: \n              type: \"integer\"\n              format: \"int64\"\n    NewPet: \n      type: \"object\"\n      required: \n        - \"name\"\n      properties: \n        name: \n          type: \"string\"\n        tag: \n          type: \"string\"\n    ErrorModel: \n      type: \"object\"\n      required: \n        - \"code\"\n        - \"message\"\n      properties: \n        code: \n          type: \"integer\"\n          format: \"int32\"\n        message: \n          type: \"string\"\n\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/yaml/petstore.yaml",
    "content": "swagger: \"2.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nhost: petstore.swagger.io\nbasePath: /v1\nschemes:\n  - http\nconsumes:\n  - application/json\nproduces:\n  - application/json\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          type: integer\n          format: int32\n      responses:\n        \"200\":\n          description: A paged array of pets\n          headers:\n            x-next:\n              type: string\n              description: A link to the next page of responses\n          schema:\n            $ref: '#/definitions/Pets'\n        default:\n          description: unexpected error\n          schema:\n            $ref: '#/definitions/Error'\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        \"201\":\n          description: Null response\n        default:\n          description: unexpected error\n          schema:\n            $ref: '#/definitions/Error'\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          type: string\n      responses:\n        \"200\":\n          description: Expected response to a valid request\n          schema:\n            $ref: '#/definitions/Pets'\n        default:\n          description: unexpected error\n          schema:\n            $ref: '#/definitions/Error'\ndefinitions:\n  Pet:\n    type: \"object\"\n    required:\n      - id\n      - name\n    properties:\n      id:\n        type: integer\n        format: int64\n      name:\n        type: string\n      tag:\n        type: string\n  Pets:\n    type: array\n    items:\n      $ref: '#/definitions/Pet'\n  Error:\n    type: \"object\"\n    required:\n      - code\n      - message\n    properties:\n      code:\n        type: integer\n        format: int32\n      message:\n        type: string\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v2.0/yaml/uber.yaml",
    "content": "# this is an example of the Uber API\n# as a demonstration of an API spec in YAML\nswagger: \"2.0\"\ninfo:\n  title: Uber API\n  description: Move your app forward with the Uber API\n  version: \"1.0.0\"\n# the domain of the service\nhost: api.uber.com\n# array of all schemes that your API supports\nschemes:\n  - https\n# will be prefixed to all paths\nbasePath: /v1\nsecurityDefinitions:\n  apikey:\n    type: apiKey\n    name: server_token\n    in: query\nproduces:\n  - application/json\npaths:\n  /products:\n    get:\n      summary: Product Types\n      description: The Products endpoint returns information about the Uber products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order.\n      parameters:\n        - name: latitude\n          in: query\n          description: Latitude component of location.\n          required: true\n          type: number\n          format: double\n        - name: longitude\n          in: query\n          description: Longitude component of location.\n          required: true\n          type: number\n          format: double\n      security: \n        - apikey: []\n      tags: \n        - Products\n      responses:  \n        \"200\":\n          description: An array of products\n          schema:\n            type: array\n            items:\n              $ref: '#/definitions/Product'\n        default:\n          description: Unexpected error\n          schema:\n            $ref: '#/definitions/Error'\n  /estimates/price:\n    get:\n      summary: Price Estimates\n      description: The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.<br><br>The response also includes low and high estimates, and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.\n      parameters:\n        - name: start_latitude\n          in: query\n          description: Latitude component of start location.\n          required: true\n          type: number\n          format: double\n        - name: start_longitude\n          in: query\n          description: Longitude component of start location.\n          required: true\n          type: number\n          format: double\n        - name: end_latitude\n          in: query\n          description: Latitude component of end location.\n          required: true\n          type: number\n          format: double\n        - name: end_longitude\n          in: query\n          description: Longitude component of end location.\n          required: true\n          type: number\n          format: double\n      tags: \n        - Estimates\n      responses:  \n        \"200\":\n          description: An array of price estimates by product\n          schema:\n            type: array\n            items:\n              $ref: '#/definitions/PriceEstimate'\n        default:\n          description: Unexpected error\n          schema:\n            $ref: '#/definitions/Error'\n  /estimates/time:\n    get:\n      summary: Time Estimates\n      description: The Time Estimates endpoint returns ETAs for all products offered at a given location, with the responses expressed as integers in seconds. We recommend that this endpoint be called every minute to provide the most accurate, up-to-date ETAs.\n      parameters:\n        - name: start_latitude\n          in: query\n          description: Latitude component of start location.\n          required: true\n          type: number\n          format: double\n        - name: start_longitude\n          in: query\n          description: Longitude component of start location.\n          required: true\n          type: number\n          format: double\n        - name: customer_uuid\n          in: query\n          type: string\n          format: uuid\n          description: Unique customer identifier to be used for experience customization.\n        - name: product_id\n          in: query\n          type: string\n          description: Unique identifier representing a specific product for a given latitude & longitude.\n      tags: \n        - Estimates\n      responses:  \n        \"200\":\n          description: An array of products\n          schema:\n            type: array\n            items:\n              $ref: '#/definitions/Product'\n        default:\n          description: Unexpected error\n          schema:\n            $ref: '#/definitions/Error'\n  /me:\n    get:\n      summary: User Profile\n      description: The User Profile endpoint returns information about the Uber user that has authorized with the application.\n      tags: \n        - User\n      responses:\n        \"200\":\n          description: Profile information for a user\n          schema:\n            $ref: '#/definitions/Profile'\n        default:\n          description: Unexpected error\n          schema:\n            $ref: '#/definitions/Error'\n  /history:\n    get:\n      summary: User Activity\n      description: The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.<br><br>The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.\n      parameters:\n        - name: offset\n          in: query\n          type: integer\n          format: int32\n          description: Offset the list of returned results by this amount. Default is zero.\n        - name: limit\n          in: query\n          type: integer\n          format: int32 \n          description: Number of items to retrieve. Default is 5, maximum is 100.\n      tags: \n        - User\n      responses:\n        \"200\":\n          description: History information for the given user\n          schema:\n            $ref: '#/definitions/Activities'\n        default:\n          description: Unexpected error\n          schema:\n            $ref: '#/definitions/Error'\ndefinitions:\n  Product:\n    properties:\n      product_id:\n        type: string\n        description: Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles.\n      description:\n        type: string\n        description: Description of product.\n      display_name:\n        type: string\n        description: Display name of product.\n      capacity:\n        type: integer\n        description: Capacity of product. For example, 4 people.\n      image:\n        type: string\n        description: Image URL representing the product.\n  ProductList:\n    properties:\n      products:\n        description: Contains the list of products\n        type: array\n        items: \n          $ref: \"#/definitions/Product\"\n  PriceEstimate:\n    properties:\n      product_id:\n        type: string\n        description: Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles\n      currency_code:\n        type: string\n        description: \"[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code.\"\n      display_name:\n        type: string\n        description: Display name of product.\n      estimate: \n        type: string\n        description: Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or \"Metered\" for TAXI.\n      low_estimate:\n        type: number\n        description: Lower bound of the estimated price.\n      high_estimate:\n        type: number\n        description: Upper bound of the estimated price.\n      surge_multiplier:\n        type: number\n        description: Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier.\n  Profile:\n    properties:\n      first_name:\n        type: string\n        description: First name of the Uber user.\n      last_name:\n        type: string\n        description: Last name of the Uber user.\n      email:\n        type: string\n        description: Email address of the Uber user\n      picture:\n        type: string\n        description: Image URL of the Uber user.\n      promo_code:\n        type: string\n        description: Promo code of the Uber user.   \n  Activity:\n    properties:\n      uuid:\n        type: string\n        description: Unique identifier for the activity\n  Activities:\n    properties:\n      offset:\n        type: integer\n        format: int32\n        description: Position in pagination.\n      limit:\n        type: integer\n        format: int32\n        description: Number of items to retrieve (100 max).\n      count:\n        type: integer\n        format: int32\n        description: Total number of items available.\n      history:\n        type: array\n        items:\n          $ref: '#/definitions/Activity'\n  Error:\n    properties:\n      code:\n        type: integer\n        format: int32\n      message:\n        type: string\n      fields:\n        type: string\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v3.0/api-with-examples.yaml",
    "content": "openapi: \"3.0.0\"\ninfo:\n  title: Simple API overview\n  version: 2.0.0\npaths:\n  /:\n    get:\n      operationId: listVersionsv2\n      summary: List API versions\n      responses:\n        '200':\n          description: |-\n            200 response\n          content:\n            application/json:\n              examples: \n                foo:\n                  value: {\n                    \"versions\": [\n                        {\n                            \"status\": \"CURRENT\",\n                            \"updated\": \"2011-01-21T11:33:21Z\",\n                            \"id\": \"v2.0\",\n                            \"links\": [\n                                {\n                                    \"href\": \"http://127.0.0.1:8774/v2/\",\n                                    \"rel\": \"self\"\n                                }\n                            ]\n                        },\n                        {\n                            \"status\": \"EXPERIMENTAL\",\n                            \"updated\": \"2013-07-23T11:33:21Z\",\n                            \"id\": \"v3.0\",\n                            \"links\": [\n                                {\n                                    \"href\": \"http://127.0.0.1:8774/v3/\",\n                                    \"rel\": \"self\"\n                                }\n                            ]\n                        }\n                    ]\n                 }\n        '300':\n          description: |-\n            300 response\n          content:\n            application/json: \n              examples: \n                foo:\n                  value: |\n                   {\n                    \"versions\": [\n                          {\n                            \"status\": \"CURRENT\",\n                            \"updated\": \"2011-01-21T11:33:21Z\",\n                            \"id\": \"v2.0\",\n                            \"links\": [\n                                {\n                                    \"href\": \"http://127.0.0.1:8774/v2/\",\n                                    \"rel\": \"self\"\n                                }\n                            ]\n                        },\n                        {\n                            \"status\": \"EXPERIMENTAL\",\n                            \"updated\": \"2013-07-23T11:33:21Z\",\n                            \"id\": \"v3.0\",\n                            \"links\": [\n                                {\n                                    \"href\": \"http://127.0.0.1:8774/v3/\",\n                                    \"rel\": \"self\"\n                                }\n                            ]\n                        }\n                    ]\n                   }\n  /v2:\n    get:\n      operationId: getVersionDetailsv2\n      summary: Show API version details\n      responses:\n        '200':\n          description: |-\n            200 response\n          content:\n            application/json: \n              examples:\n                foo:\n                  value: {\n                    \"version\": {\n                      \"status\": \"CURRENT\",\n                      \"updated\": \"2011-01-21T11:33:21Z\",\n                      \"media-types\": [\n                          {\n                              \"base\": \"application/xml\",\n                              \"type\": \"application/vnd.openstack.compute+xml;version=2\"\n                          },\n                          {\n                              \"base\": \"application/json\",\n                              \"type\": \"application/vnd.openstack.compute+json;version=2\"\n                          }\n                      ],\n                      \"id\": \"v2.0\",\n                      \"links\": [\n                          {\n                              \"href\": \"http://127.0.0.1:8774/v2/\",\n                              \"rel\": \"self\"\n                          },\n                          {\n                              \"href\": \"http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf\",\n                              \"type\": \"application/pdf\",\n                              \"rel\": \"describedby\"\n                          },\n                          {\n                              \"href\": \"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\",\n                              \"type\": \"application/vnd.sun.wadl+xml\",\n                              \"rel\": \"describedby\"\n                          },\n                          {\n                            \"href\": \"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\",\n                            \"type\": \"application/vnd.sun.wadl+xml\",\n                            \"rel\": \"describedby\"\n                          }\n                      ]\n                    }\n                  }\n        '203':\n          description: |-\n            203 response\n          content:\n            application/json: \n              examples:\n                foo:\n                  value: {\n                    \"version\": {\n                      \"status\": \"CURRENT\",\n                      \"updated\": \"2011-01-21T11:33:21Z\",\n                      \"media-types\": [\n                          {\n                              \"base\": \"application/xml\",\n                              \"type\": \"application/vnd.openstack.compute+xml;version=2\"\n                          },\n                          {\n                              \"base\": \"application/json\",\n                              \"type\": \"application/vnd.openstack.compute+json;version=2\"\n                          }\n                      ],\n                      \"id\": \"v2.0\",\n                      \"links\": [\n                          {\n                              \"href\": \"http://23.253.228.211:8774/v2/\",\n                              \"rel\": \"self\"\n                          },\n                          {\n                              \"href\": \"http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf\",\n                              \"type\": \"application/pdf\",\n                              \"rel\": \"describedby\"\n                          },\n                          {\n                              \"href\": \"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\",\n                              \"type\": \"application/vnd.sun.wadl+xml\",\n                              \"rel\": \"describedby\"\n                          }\n                      ]\n                    }\n                  }\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v3.0/callback-example.yaml",
    "content": "openapi: 3.0.0\ninfo:\n  title: Callback Example\n  version: 1.0.0\npaths:\n  /streams:\n    post:\n      description: subscribes a client to receive out-of-band data\n      parameters:\n        - name: callbackUrl\n          in: query\n          required: true\n          description: |\n            the location where data will be sent.  Must be network accessible\n            by the source server\n          schema:\n            type: string\n            format: uri\n            example: https://tonys-server.com\n      responses:\n        '201':\n          description: subscription successfully created\n          content:\n            application/json:\n              schema:\n                description: subscription information\n                required:\n                  - subscriptionId\n                properties:\n                  subscriptionId:\n                    description: this unique identifier allows management of the subscription\n                    type: string\n                    example: 2531329f-fb09-4ef7-887e-84e648214436\n      callbacks:\n        # the name `onData` is a convenience locator\n        onData:\n          # when data is sent, it will be sent to the `callbackUrl` provided\n          # when making the subscription PLUS the suffix `/data`\n          '{$request.query.callbackUrl}/data':\n            post:\n              requestBody:\n                description: subscription payload\n                content:\n                  application/json:\n                    schema:\n                      type: object\n                      properties:\n                        timestamp:\n                          type: string\n                          format: date-time\n                        userData:\n                          type: string\n              responses:\n                '202':\n                  description: |\n                    Your server implementation should return this HTTP status code\n                    if the data was received successfully\n                '204':\n                  description: |\n                    Your server should return this HTTP status code if no longer interested\n                    in further updates\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v3.0/link-example.yaml",
    "content": "openapi: 3.0.0\ninfo: \n  title: Link Example\n  version: 1.0.0\npaths: \n  /2.0/users/{username}: \n    get: \n      operationId: getUserByName\n      parameters: \n      - name: username\n        in: path\n        required: true\n        schema:\n          type: string\n      responses: \n        '200':\n          description: The User\n          content:\n            application/json:\n              schema: \n                $ref: '#/components/schemas/user'\n          links:\n            userRepositories:\n              $ref: '#/components/links/UserRepositories'\n  /2.0/repositories/{username}:\n    get:\n      operationId: getRepositoriesByOwner\n      parameters:\n        - name: username\n          in: path\n          required: true\n          schema:\n            type: string\n      responses:\n        '200':\n          description: repositories owned by the supplied user\n          content: \n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: '#/components/schemas/repository'\n          links:\n            userRepository:\n              $ref: '#/components/links/UserRepository'\n  /2.0/repositories/{username}/{slug}: \n    get: \n      operationId: getRepository\n      parameters: \n        - name: username\n          in: path\n          required: true\n          schema:\n            type: string\n        - name: slug\n          in: path\n          required: true\n          schema:\n            type: string\n      responses: \n        '200':\n          description: The repository\n          content:\n              application/json: \n                schema: \n                  $ref: '#/components/schemas/repository'\n          links:\n            repositoryPullRequests:\n              $ref: '#/components/links/RepositoryPullRequests'\n  /2.0/repositories/{username}/{slug}/pullrequests: \n    get: \n      operationId: getPullRequestsByRepository\n      parameters: \n      - name: username\n        in: path\n        required: true\n        schema:\n          type: string\n      - name: slug\n        in: path\n        required: true\n        schema:\n          type: string\n      - name: state\n        in: query\n        schema:\n          type: string\n          enum: \n            - open\n            - merged\n            - declined\n      responses: \n        '200':\n          description: an array of pull request objects\n          content:\n            application/json: \n              schema: \n                type: array\n                items: \n                  $ref: '#/components/schemas/pullrequest'\n  /2.0/repositories/{username}/{slug}/pullrequests/{pid}: \n    get: \n      operationId: getPullRequestsById\n      parameters: \n      - name: username\n        in: path\n        required: true\n        schema:\n          type: string\n      - name: slug\n        in: path\n        required: true\n        schema:\n          type: string\n      - name: pid\n        in: path\n        required: true\n        schema:\n          type: string\n      responses: \n        '200':\n          description: a pull request object\n          content:\n            application/json: \n              schema: \n                $ref: '#/components/schemas/pullrequest'\n          links:\n            pullRequestMerge:\n              $ref: '#/components/links/PullRequestMerge'\n  /2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge: \n    post: \n      operationId: mergePullRequest\n      parameters: \n      - name: username\n        in: path\n        required: true\n        schema:\n          type: string\n      - name: slug\n        in: path\n        required: true\n        schema:\n          type: string\n      - name: pid\n        in: path\n        required: true\n        schema:\n          type: string\n      responses: \n        '204':\n          description: the PR was successfully merged\ncomponents:\n  links:\n    UserRepositories:\n      # returns array of '#/components/schemas/repository'\n      operationId: getRepositoriesByOwner\n      parameters:\n        username: $response.body#/username\n    UserRepository:\n      # returns '#/components/schemas/repository'\n      operationId: getRepository\n      parameters:\n        username: $response.body#/owner/username\n        slug: $response.body#/slug\n    RepositoryPullRequests:\n      # returns '#/components/schemas/pullrequest'\n      operationId: getPullRequestsByRepository\n      parameters: \n          username: $response.body#/owner/username\n          slug: $response.body#/slug\n    PullRequestMerge:\n      # executes /2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge\n      operationId: mergePullRequest\n      parameters:\n        username: $response.body#/author/username\n        slug: $response.body#/repository/slug\n        pid: $response.body#/id\n  schemas: \n    user: \n      type: object\n      properties: \n        username: \n          type: string\n        uuid: \n          type: string\n    repository: \n      type: object\n      properties: \n        slug: \n          type: string\n        owner: \n          $ref: '#/components/schemas/user'\n    pullrequest: \n      type: object\n      properties: \n        id: \n          type: integer\n        title: \n          type: string\n        repository: \n          $ref: '#/components/schemas/repository'\n        author: \n          $ref: '#/components/schemas/user'\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v3.0/petstore-expanded.yaml",
    "content": "openapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  description: A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification\n  termsOfService: http://swagger.io/terms/\n  contact:\n    name: Swagger API Team\n    email: apiteam@swagger.io\n    url: http://swagger.io\n  license:\n    name: Apache 2.0\n    url: https://www.apache.org/licenses/LICENSE-2.0.html\nservers:\n  - url: http://petstore.swagger.io/api\npaths:\n  /pets:\n    get:\n      description: |\n        Returns all pets from the system that the user has access to\n        Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.\n\n        Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.\n      operationId: findPets\n      parameters:\n        - name: tags\n          in: query\n          description: tags to filter by\n          required: false\n          style: form\n          schema:\n            type: array\n            items:\n              type: string\n        - name: limit\n          in: query\n          description: maximum number of results to return\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: pet response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: '#/components/schemas/Pet'\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Error'\n    post:\n      description: Creates a new pet in the store.  Duplicates are allowed\n      operationId: addPet\n      requestBody:\n        description: Pet to add to the store\n        required: true\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/NewPet'\n      responses:\n        '200':\n          description: pet response\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Pet'\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Error'\n  /pets/{id}:\n    get:\n      description: Returns a user based on a single ID, if the user does not have access to the pet\n      operationId: find pet by id\n      parameters:\n        - name: id\n          in: path\n          description: ID of pet to fetch\n          required: true\n          schema:\n            type: integer\n            format: int64\n      responses:\n        '200':\n          description: pet response\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Pet'\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Error'\n    delete:\n      description: deletes a single pet based on the ID supplied\n      operationId: deletePet\n      parameters:\n        - name: id\n          in: path\n          description: ID of pet to delete\n          required: true\n          schema:\n            type: integer\n            format: int64\n      responses:\n        '204':\n          description: pet deleted\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Error'\ncomponents:\n  schemas:\n    Pet:\n      allOf:\n        - $ref: '#/components/schemas/NewPet'\n        - type: object\n          required:\n          - id\n          properties:\n            id:\n              type: integer\n              format: int64\n\n    NewPet:\n      type: object\n      required:\n        - name  \n      properties:\n        name:\n          type: string\n        tag:\n          type: string    \n\n    Error:\n      type: object\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v3.0/petstore.yaml",
    "content": "openapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:    \n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pet\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      type: object\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      type: object\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "codegen/src/test/resources/examples/v3.0/uspto.yaml",
    "content": "openapi: 3.0.1\nservers:\n  - url: '{scheme}://developer.uspto.gov/ds-api'\n    variables:\n      scheme:\n        description: 'The Data Set API is accessible via https and http'\n        enum:\n          - 'https'\n          - 'http'\n        default: 'https'\ninfo:\n  description: >-\n    The Data Set API (DSAPI) allows the public users to discover and search\n    USPTO exported data sets. This is a generic API that allows USPTO users to\n    make any CSV based data files searchable through API. With the help of GET\n    call, it returns the list of data fields that are searchable. With the help\n    of POST call, data can be fetched based on the filters on the field names.\n    Please note that POST call is used to search the actual data. The reason for\n    the POST call is that it allows users to specify any complex search criteria\n    without worry about the GET size limitations as well as encoding of the\n    input parameters.\n  version: 1.0.0\n  title: USPTO Data Set API\n  contact:\n    name: Open Data Portal\n    url: 'https://developer.uspto.gov'\n    email: developer@uspto.gov\ntags:\n  - name: metadata\n    description: Find out about the data sets\n  - name: search\n    description: Search a data set\npaths:\n  /:\n    get:\n      tags:\n        - metadata\n      operationId: list-data-sets\n      summary: List available data sets\n      responses:\n        '200':\n          description: Returns a list of data sets\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/dataSetList'\n              example:\n                {\n                  \"total\": 2,\n                  \"apis\": [\n                    {\n                      \"apiKey\": \"oa_citations\",\n                      \"apiVersionNumber\": \"v1\",\n                      \"apiUrl\": \"https://developer.uspto.gov/ds-api/oa_citations/v1/fields\",\n                      \"apiDocumentationUrl\": \"https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/oa_citations.json\"\n                    },\n                    {\n                      \"apiKey\": \"cancer_moonshot\",\n                      \"apiVersionNumber\": \"v1\",\n                      \"apiUrl\": \"https://developer.uspto.gov/ds-api/cancer_moonshot/v1/fields\",\n                      \"apiDocumentationUrl\": \"https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/cancer_moonshot.json\"\n                    }\n                  ]\n                }\n  /{dataset}/{version}/fields:\n    get:\n      tags:\n        - metadata\n      summary: >-\n        Provides the general information about the API and the list of fields\n        that can be used to query the dataset.\n      description: >-\n        This GET API returns the list of all the searchable field names that are\n        in the oa_citations. Please see the 'fields' attribute which returns an\n        array of field names. Each field or a combination of fields can be\n        searched using the syntax options shown below.\n      operationId: list-searchable-fields\n      parameters:\n        - name: dataset\n          in: path\n          description: 'Name of the dataset.'\n          required: true\n          example: \"oa_citations\"\n          schema:\n            type: string\n        - name: version\n          in: path\n          description: Version of the dataset.\n          required: true\n          example: \"v1\"\n          schema:\n            type: string\n      responses:\n        '200':\n          description: >-\n            The dataset API for the given version is found and it is accessible\n            to consume.\n          content:\n            application/json:\n              schema:\n                type: string\n        '404':\n          description: >-\n            The combination of dataset name and version is not found in the\n            system or it is not published yet to be consumed by public.\n          content:\n            application/json:\n              schema:\n                type: string\n  /{dataset}/{version}/records:\n    post:\n      tags:\n        - search\n      summary: >-\n        Provides search capability for the data set with the given search\n        criteria.\n      description: >-\n        This API is based on Solr/Lucense Search. The data is indexed using\n        SOLR. This GET API returns the list of all the searchable field names\n        that are in the Solr Index. Please see the 'fields' attribute which\n        returns an array of field names. Each field or a combination of fields\n        can be searched using the Solr/Lucene Syntax. Please refer\n        https://lucene.apache.org/core/3_6_2/queryparsersyntax.html#Overview for\n        the query syntax. List of field names that are searchable can be\n        determined using above GET api.\n      operationId: perform-search\n      parameters:\n        - name: version\n          in: path\n          description: Version of the dataset.\n          required: true\n          schema:\n            type: string\n            default: v1\n        - name: dataset\n          in: path\n          description: 'Name of the dataset. In this case, the default value is oa_citations'\n          required: true\n          schema:\n            type: string\n            default: oa_citations\n      responses:\n        '200':\n          description: successful operation\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  type: object\n                  additionalProperties:\n                    type: object\n        '404':\n          description: No matching record found for the given criteria.\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                criteria:\n                  description: >-\n                    Uses Lucene Query Syntax in the format of\n                    propertyName:value, propertyName:[num1 TO num2] and date\n                    range format: propertyName:[yyyyMMdd TO yyyyMMdd]. In the\n                    response please see the 'docs' element which has the list of\n                    record objects. Each record structure would consist of all\n                    the fields and their corresponding values.\n                  type: string\n                  default: '*:*'\n                start:\n                  description: Starting record number. Default value is 0.\n                  type: integer\n                  default: 0\n                rows:\n                  description: >-\n                    Specify number of rows to be returned. If you run the search\n                    with default values, in the response you will see 'numFound'\n                    attribute which will tell the number of records available in\n                    the dataset.\n                  type: integer\n                  default: 100\n              required:\n                - criteria\ncomponents:\n  schemas:\n    dataSetList:\n      type: object\n      properties:\n        total:\n          type: integer\n        apis:\n          type: array\n          items:\n            type: object\n            properties:\n              apiKey:\n                type: string\n                description: To be used as a dataset parameter value\n              apiVersionNumber:\n                type: string\n                description: To be used as a version parameter value\n              apiUrl:\n                type: string\n                format: uriref\n                description: \"The URL describing the dataset's fields\"\n              apiDocumentationUrl:\n                type: string\n                format: uriref\n                description: A URL to the API console for each API\n"
  },
  {
    "path": "codegen/src/test/resources/log4j2-test.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!--this is sample configuration, please modify as your wish-->\n\n<configuration>\n  <loggers>\n    <logger name=\"org.openapitools\" additivity=\"false\" level=\"OFF\">\n    </logger>\n  </loggers>\n</configuration>"
  },
  {
    "path": "codegen/src/test/resources/no-model.yaml",
    "content": "---\nswagger: \"2.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"no model\"\n  license:\n    name: \"Apache 2.0\"\n    url: \"http://www.apache.org/licenses/LICENSE-2.0.html\"\nbasePath: \"/\"\npaths:\n  /sayHi:\n    get:\n      operationId: \"sayHi\"\n      parameters:\n      - in: \"query\"\n        name: \"name\"\n        type: \"string\"\n      responses:\n        200:\n          description: \"success\"\n          schema:\n            type: \"string\""
  },
  {
    "path": "codegen/src/test/resources/swagger.yaml",
    "content": "---\nswagger: \"2.0\"\ninfo:\n  description: \"This is a sample server Petstore server.  You can find out more about\\\n    \\ Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\\\n    \\  For this sample, you can use the api key `special-key` to test the authorization\\\n    \\ filters.\"\n  version: \"1.0.0\"\n  title: \"Swagger Petstore\"\n  termsOfService: \"http://swagger.io/terms/\"\n  contact:\n    email: \"apiteam@swagger.io\"\n  license:\n    name: \"Apache 2.0\"\n    url: \"http://www.apache.org/licenses/LICENSE-2.0.html\"\nhost: \"petstore.swagger.io\"\nbasePath: \"/v2\"\ntags:\n- name: \"pet\"\n  description: \"Everything about your Pets\"\n  externalDocs:\n    description: \"Find out more\"\n    url: \"http://swagger.io\"\n- name: \"store\"\n  description: \"Access to Petstore orders\"\n- name: \"user\"\n  description: \"Operations about user\"\n  externalDocs:\n    description: \"Find out more about our store\"\n    url: \"http://swagger.io\"\nschemes:\n- \"https\"\n- \"http\"\npaths:\n  /pet:\n    post:\n      tags:\n      - \"pet\"\n      summary: \"Add a new pet to the store\"\n      description: \"\"\n      operationId: \"addPet\"\n      consumes:\n      - \"application/json\"\n      - \"application/xml\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - in: \"body\"\n        name: \"body\"\n        description: \"Pet object that needs to be added to the store\"\n        required: true\n        schema:\n          $ref: \"#/definitions/Pet\"\n      responses:\n        405:\n          description: \"Invalid input\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n    put:\n      tags:\n      - \"pet\"\n      summary: \"Update an existing pet\"\n      description: \"\"\n      operationId: \"updatePet\"\n      consumes:\n      - \"application/json\"\n      - \"application/xml\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - in: \"body\"\n        name: \"body\"\n        description: \"Pet object that needs to be added to the store\"\n        required: true\n        schema:\n          $ref: \"#/definitions/Pet\"\n      responses:\n        400:\n          description: \"Invalid ID supplied\"\n        404:\n          description: \"Pet not found\"\n        405:\n          description: \"Validation exception\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n  /pet/findByStatus:\n    get:\n      tags:\n      - \"pet\"\n      summary: \"Finds Pets by status\"\n      description: \"Multiple status values can be provided with comma separated strings\"\n      operationId: \"findPetsByStatus\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"status\"\n        in: \"query\"\n        description: \"Status values that need to be considered for filter\"\n        required: true\n        type: \"array\"\n        items:\n          type: \"string\"\n          enum:\n          - \"available\"\n          - \"pending\"\n          - \"sold\"\n          default: \"available\"\n        collectionFormat: \"multi\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            type: \"array\"\n            items:\n              $ref: \"#/definitions/Pet\"\n        400:\n          description: \"Invalid status value\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n  /pet/findByTags:\n    get:\n      tags:\n      - \"pet\"\n      summary: \"Finds Pets by tags\"\n      description: \"Multiple tags can be provided with comma separated strings. Use\\\n        \\ tag1, tag2, tag3 for testing.\"\n      operationId: \"findPetsByTags\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"tags\"\n        in: \"query\"\n        description: \"Tags to filter by\"\n        required: true\n        type: \"array\"\n        items:\n          type: \"string\"\n        collectionFormat: \"multi\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            type: \"array\"\n            items:\n              $ref: \"#/definitions/Pet\"\n        400:\n          description: \"Invalid tag value\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n      deprecated: true\n  /pet/{petId}:\n    get:\n      tags:\n      - \"pet\"\n      summary: \"Find pet by ID\"\n      description: \"Returns a single pet\"\n      operationId: \"getPetById\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"petId\"\n        in: \"path\"\n        description: \"ID of pet to return\"\n        required: true\n        type: \"integer\"\n        format: \"int64\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            $ref: \"#/definitions/Pet\"\n        400:\n          description: \"Invalid ID supplied\"\n        404:\n          description: \"Pet not found\"\n      security:\n      - api_key: []\n    post:\n      tags:\n      - \"pet\"\n      summary: \"Updates a pet in the store with form data\"\n      description: \"\"\n      operationId: \"updatePetWithForm\"\n      consumes:\n      - \"application/x-www-form-urlencoded\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"petId\"\n        in: \"path\"\n        description: \"ID of pet that needs to be updated\"\n        required: true\n        type: \"integer\"\n        format: \"int64\"\n      - name: \"name\"\n        in: \"formData\"\n        description: \"Updated name of the pet\"\n        required: false\n        type: \"string\"\n      - name: \"status\"\n        in: \"formData\"\n        description: \"Updated status of the pet\"\n        required: false\n        type: \"string\"\n      responses:\n        405:\n          description: \"Invalid input\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n    delete:\n      tags:\n      - \"pet\"\n      summary: \"Deletes a pet\"\n      description: \"\"\n      operationId: \"deletePet\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"api_key\"\n        in: \"header\"\n        required: false\n        type: \"string\"\n      - name: \"petId\"\n        in: \"path\"\n        description: \"Pet id to delete\"\n        required: true\n        type: \"integer\"\n        format: \"int64\"\n      responses:\n        400:\n          description: \"Invalid ID supplied\"\n        404:\n          description: \"Pet not found\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n  /pet/{petId}/uploadImage:\n    post:\n      tags:\n      - \"pet\"\n      summary: \"uploads an image\"\n      description: \"\"\n      operationId: \"uploadFile\"\n      consumes:\n      - \"multipart/form-data\"\n      produces:\n      - \"application/json\"\n      parameters:\n      - name: \"petId\"\n        in: \"path\"\n        description: \"ID of pet to update\"\n        required: true\n        type: \"integer\"\n        format: \"int64\"\n      - name: \"additionalMetadata\"\n        in: \"formData\"\n        description: \"Additional data to pass to server\"\n        required: false\n        type: \"string\"\n      - name: \"file\"\n        in: \"formData\"\n        description: \"file to upload\"\n        required: false\n        type: \"file\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            $ref: \"#/definitions/ApiResponse\"\n      security:\n      - petstore_auth:\n        - \"write:pets\"\n        - \"read:pets\"\n  /store/inventory:\n    get:\n      tags:\n      - \"store\"\n      summary: \"Returns pet inventories by status\"\n      description: \"Returns a map of status codes to quantities\"\n      operationId: \"getInventory\"\n      produces:\n      - \"application/json\"\n      parameters: []\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            type: \"object\"\n            additionalProperties:\n              type: \"integer\"\n              format: \"int32\"\n      security:\n      - api_key: []\n  /store/order:\n    post:\n      tags:\n      - \"store\"\n      summary: \"Place an order for a pet\"\n      description: \"\"\n      operationId: \"placeOrder\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - in: \"body\"\n        name: \"body\"\n        description: \"order placed for purchasing the pet\"\n        required: true\n        schema:\n          $ref: \"#/definitions/Order\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            $ref: \"#/definitions/Order\"\n        400:\n          description: \"Invalid Order\"\n  /store/order/{orderId}:\n    get:\n      tags:\n      - \"store\"\n      summary: \"Find purchase order by ID\"\n      description: \"For valid response try integer IDs with value >= 1 and <= 10.\\\n        \\ Other values will generated exceptions\"\n      operationId: \"getOrderById\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"orderId\"\n        in: \"path\"\n        description: \"ID of pet that needs to be fetched\"\n        required: true\n        type: \"integer\"\n        maximum: 10.0\n        minimum: 1.0\n        format: \"int64\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            $ref: \"#/definitions/Order\"\n        400:\n          description: \"Invalid ID supplied\"\n        404:\n          description: \"Order not found\"\n    delete:\n      tags:\n      - \"store\"\n      summary: \"Delete purchase order by ID\"\n      description: \"For valid response try integer IDs with positive integer value.\\\n        \\ Negative or non-integer values will generate API errors\"\n      operationId: \"deleteOrder\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"orderId\"\n        in: \"path\"\n        description: \"ID of the order that needs to be deleted\"\n        required: true\n        type: \"integer\"\n        minimum: 1.0\n        format: \"int64\"\n      responses:\n        400:\n          description: \"Invalid ID supplied\"\n        404:\n          description: \"Order not found\"\n  /user:\n    post:\n      tags:\n      - \"user\"\n      summary: \"Create user\"\n      description: \"This can only be done by the logged in user.\"\n      operationId: \"createUser\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - in: \"body\"\n        name: \"body\"\n        description: \"Created user object\"\n        required: true\n        schema:\n          $ref: \"#/definitions/User\"\n      responses:\n        default:\n          description: \"successful operation\"\n  /user/createWithArray:\n    post:\n      tags:\n      - \"user\"\n      summary: \"Creates list of users with given input array\"\n      description: \"\"\n      operationId: \"createUsersWithArrayInput\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - in: \"body\"\n        name: \"body\"\n        description: \"List of user object\"\n        required: true\n        schema:\n          type: \"array\"\n          items:\n            $ref: \"#/definitions/User\"\n      responses:\n        default:\n          description: \"successful operation\"\n  /user/createWithList:\n    post:\n      tags:\n      - \"user\"\n      summary: \"Creates list of users with given input array\"\n      description: \"\"\n      operationId: \"createUsersWithListInput\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - in: \"body\"\n        name: \"body\"\n        description: \"List of user object\"\n        required: true\n        schema:\n          type: \"array\"\n          items:\n            $ref: \"#/definitions/User\"\n      responses:\n        default:\n          description: \"successful operation\"\n  /user/login:\n    get:\n      tags:\n      - \"user\"\n      summary: \"Logs user into the system\"\n      description: \"\"\n      operationId: \"loginUser\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"username\"\n        in: \"query\"\n        description: \"The user name for login\"\n        required: true\n        type: \"string\"\n      - name: \"password\"\n        in: \"query\"\n        description: \"The password for login in clear text\"\n        required: true\n        type: \"string\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            type: \"string\"\n          headers:\n            X-Rate-Limit:\n              type: \"integer\"\n              format: \"int32\"\n              description: \"calls per hour allowed by the user\"\n            X-Expires-After:\n              type: \"string\"\n              format: \"date-time\"\n              description: \"date in UTC when token expires\"\n        400:\n          description: \"Invalid username/password supplied\"\n  /user/logout:\n    get:\n      tags:\n      - \"user\"\n      summary: \"Logs out current logged in user session\"\n      description: \"\"\n      operationId: \"logoutUser\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters: []\n      responses:\n        default:\n          description: \"successful operation\"\n  /user/{username}:\n    get:\n      tags:\n      - \"user\"\n      summary: \"Get user by user name\"\n      description: \"\"\n      operationId: \"getUserByName\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"username\"\n        in: \"path\"\n        description: \"The name that needs to be fetched. Use user1 for testing. \"\n        required: true\n        type: \"string\"\n      responses:\n        200:\n          description: \"successful operation\"\n          schema:\n            $ref: \"#/definitions/User\"\n        400:\n          description: \"Invalid username supplied\"\n        404:\n          description: \"User not found\"\n    put:\n      tags:\n      - \"user\"\n      summary: \"Updated user\"\n      description: \"This can only be done by the logged in user.\"\n      operationId: \"updateUser\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"username\"\n        in: \"path\"\n        description: \"name that need to be updated\"\n        required: true\n        type: \"string\"\n      - in: \"body\"\n        name: \"body\"\n        description: \"Updated user object\"\n        required: true\n        schema:\n          $ref: \"#/definitions/User\"\n      responses:\n        400:\n          description: \"Invalid user supplied\"\n        404:\n          description: \"User not found\"\n    delete:\n      tags:\n      - \"user\"\n      summary: \"Delete user\"\n      description: \"This can only be done by the logged in user.\"\n      operationId: \"deleteUser\"\n      produces:\n      - \"application/xml\"\n      - \"application/json\"\n      parameters:\n      - name: \"username\"\n        in: \"path\"\n        description: \"The name that needs to be deleted\"\n        required: true\n        type: \"string\"\n      responses:\n        400:\n          description: \"Invalid username supplied\"\n        404:\n          description: \"User not found\"\nsecurityDefinitions:\n  petstore_auth:\n    type: \"oauth2\"\n    authorizationUrl: \"https://petstore.swagger.io/oauth/authorize\"\n    flow: \"implicit\"\n    scopes:\n      write:pets: \"modify pets in your account\"\n      read:pets: \"read your pets\"\n  api_key:\n    type: \"apiKey\"\n    name: \"api_key\"\n    in: \"header\"\ndefinitions:\n  Order:\n    type: \"object\"\n    properties:\n      id:\n        type: \"integer\"\n        format: \"int64\"\n      petId:\n        type: \"integer\"\n        format: \"int64\"\n      quantity:\n        type: \"integer\"\n        format: \"int32\"\n      shipDate:\n        type: \"string\"\n        format: \"date-time\"\n      status:\n        type: \"string\"\n        description: \"Order Status\"\n        enum:\n        - \"placed\"\n        - \"approved\"\n        - \"delivered\"\n      complete:\n        type: \"boolean\"\n        default: false\n    xml:\n      name: \"Order\"\n  User:\n    type: \"object\"\n    properties:\n      id:\n        type: \"integer\"\n        format: \"int64\"\n      username:\n        type: \"string\"\n      firstName:\n        type: \"string\"\n      lastName:\n        type: \"string\"\n      email:\n        type: \"string\"\n      password:\n        type: \"string\"\n      phone:\n        type: \"string\"\n      userStatus:\n        type: \"integer\"\n        format: \"int32\"\n        description: \"User Status\"\n    xml:\n      name: \"User\"\n  Category:\n    type: \"object\"\n    properties:\n      id:\n        type: \"integer\"\n        format: \"int64\"\n      name:\n        type: \"string\"\n    xml:\n      name: \"Category\"\n  Tag:\n    type: \"object\"\n    properties:\n      id:\n        type: \"integer\"\n        format: \"int64\"\n      name:\n        type: \"string\"\n    xml:\n      name: \"Tag\"\n  Pet:\n    type: \"object\"\n    required:\n    - \"name\"\n    - \"photoUrls\"\n    properties:\n      id:\n        type: \"integer\"\n        format: \"int64\"\n      category:\n        $ref: \"#/definitions/Category\"\n      name:\n        type: \"string\"\n        example: \"doggie\"\n      photoUrls:\n        type: \"array\"\n        xml:\n          name: \"photoUrl\"\n          wrapped: true\n        items:\n          type: \"string\"\n      tags:\n        type: \"array\"\n        xml:\n          name: \"tag\"\n          wrapped: true\n        items:\n          $ref: \"#/definitions/Tag\"\n      status:\n        type: \"string\"\n        description: \"pet status in the store\"\n        enum:\n        - \"available\"\n        - \"pending\"\n        - \"sold\"\n    xml:\n      name: \"Pet\"\n  ApiResponse:\n    type: \"object\"\n    properties:\n      code:\n        type: \"integer\"\n        format: \"int32\"\n      type:\n        type: \"string\"\n      message:\n        type: \"string\"\nexternalDocs:\n  description: \"Find out more about Swagger\"\n  url: \"http://swagger.io\"\n"
  },
  {
    "path": "codegen/src/test/resources/with-model.yaml",
    "content": "swagger: '2.0'\ninfo:\n  version: \"1.0.0\"\n  title: \"no-model\"\n  license:\n    name: \"Apache 2.0\"\n    url: \"http://www.apache.org/licenses/LICENSE-2.0.html\"\nbasePath: \"/\"\npaths:\n  /getUser:\n    get:\n      parameters:\n        - in: \"query\"\n          name: \"id\"\n          type: \"string\"\n      responses:\n        200:\n          description: \"success\"\n          schema:\n            $ref: '#/definitions/User'\ndefinitions:\n  User:\n    type: object\n    properties:\n      id:\n        type: string\n      name:\n        type: string\n"
  },
  {
    "path": "common/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>toolkit</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>common</artifactId>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>core</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.eclipse.jgit</groupId>\n      <artifactId>org.eclipse.jgit</artifactId>\n      <exclusions>\n        <exclusion>\n          <groupId>org.bouncycastle</groupId>\n          <artifactId>bcpkix-jdk15on</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>org.bouncycastle</groupId>\n          <artifactId>bcpg-jdk15on</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>org.bouncycastle</groupId>\n          <artifactId>bcprov-jdk15on</artifactId>\n        </exclusion>\n      </exclusions>\n    </dependency>\n\n    <dependency>\n      <groupId>junit</groupId>\n      <artifactId>junit</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.mockito</groupId>\n      <artifactId>mockito-core</artifactId>\n      <scope>test</scope>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>\n"
  },
  {
    "path": "common/src/main/java/org/apache/servicecomb/toolkit/common/ClassMaker.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.util.concurrent.TimeoutException;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic class ClassMaker {\n\n  public static void compile(String projectPath) throws IOException, TimeoutException, InterruptedException {\n    Runtime runtime = Runtime.getRuntime();\n\n    boolean isWindows = System.getProperty(\"os.name\").toLowerCase().indexOf(\"win\") >= 0;\n    String mvnCommand = (isWindows ? \"mvn.cmd\" : \"mvn\") + \" clean package -f \" + projectPath;\n    Process exec = runtime.exec(mvnCommand);\n\n    Worker worker = new Worker(exec);\n    worker.start();\n    ProcessStatus ps = worker.getProcessStatus();\n\n    try {\n      worker.join(30000);\n      if (ps.exitCode == ProcessStatus.CODE_FAIL) {\n        throw new RuntimeException(\"Command exec fail,command is: \" + mvnCommand);\n      }\n      if (ps.exitCode == ProcessStatus.CODE_STARTED) {\n        // not finished\n        worker.interrupt();\n        throw new TimeoutException();\n      }\n    } catch (InterruptedException e) {\n      // canceled by other thread.\n      worker.interrupt();\n      throw e;\n    }\n  }\n\n  private static class Worker extends Thread {\n    private final Process process;\n\n    private ProcessStatus ps;\n\n    private Worker(Process process) {\n      this.process = process;\n      this.ps = new ProcessStatus();\n    }\n\n    @Override\n    public void run() {\n      try {\n        new ExecReader(process.getInputStream(), \"Command Exec Result Reader\") {\n          @Override\n          public void afterReadLine(String line) {\n            LOGGER.info(line);\n          }\n        }.start();\n\n        new ExecReader(process.getErrorStream(), \"Command Exec Error Reader\") {\n          @Override\n          public void afterReadLine(String line) {\n            LOGGER.error(line);\n          }\n        }.start();\n\n        ps.exitCode = process.waitFor();\n      } catch (InterruptedException e) {\n        Thread.currentThread().interrupt();\n      }\n    }\n\n    ProcessStatus getProcessStatus() {\n      return this.ps;\n    }\n  }\n\n  public static class ProcessStatus {\n    static final int CODE_STARTED = -257;\n\n    static final int CODE_FAIL = 1;\n\n    volatile int exitCode;\n\n    volatile String output;\n  }\n\n  private static abstract class ExecReader extends Thread {\n\n    public final Logger LOGGER;\n\n    private final InputStream is;\n\n    private final String readerName;\n\n    public ExecReader(InputStream is, String readerName) {\n      this.is = is;\n      this.readerName = readerName;\n      LOGGER = LoggerFactory.getLogger(ExecReader.class.getName() + \"-\" + readerName);\n    }\n\n    @Override\n    public void run() {\n      BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n      String line = null;\n      try {\n\n        while ((line = reader.readLine()) != null) {\n          afterReadLine(line);\n        }\n      } catch (IOException e) {\n        LOGGER.error(readerName, e);\n      }\n    }\n\n    public abstract void afterReadLine(String line);\n  }\n}\n"
  },
  {
    "path": "common/src/main/java/org/apache/servicecomb/toolkit/common/CompareAlgorithm.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\nimport java.util.List;\n\npublic interface CompareAlgorithm {\n\n  List<Comparison> compare(String source, String dest);\n}\n"
  },
  {
    "path": "common/src/main/java/org/apache/servicecomb/toolkit/common/ComparisionType.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\npublic enum ComparisionType {\n\n  /** insert new content */\n  INSERT,\n\n  /** delete content */\n  DELETE,\n\n  /** replace old content */\n  REPLACE,\n\n  /** not change */\n  EQUAL;\n}\n"
  },
  {
    "path": "common/src/main/java/org/apache/servicecomb/toolkit/common/Comparison.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\npublic class Comparison {\n\n  public final ComparisionType type;\n\n  public final int originalPointBegin;\n\n  public final int originalPointEnd;\n\n  public final int destinationPointBegin;\n\n  public final int destinationPointEnd;\n\n  public Comparison(ComparisionType type, int originalPointBegin, int originalPointEnd, int destinationPointBegin,\n      int destinationPointEnd) {\n    this.type = type;\n    this.originalPointBegin = originalPointBegin;\n    this.originalPointEnd = originalPointEnd;\n    this.destinationPointBegin = destinationPointBegin;\n    this.destinationPointEnd = destinationPointEnd;\n  }\n}\n"
  },
  {
    "path": "common/src/main/java/org/apache/servicecomb/toolkit/common/ContractComparator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\nimport java.io.IOException;\nimport java.io.OutputStream;\nimport java.util.List;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic class ContractComparator {\n\n  private final static Logger LOGGER = LoggerFactory.getLogger(ContractComparator.class);\n\n  private CompareAlgorithm algorithm;\n\n  private String source;\n\n  private String dest;\n\n  private List<Comparison> comparisonList;\n\n  public ContractComparator(String source, String dest) {\n    this(source, dest, new MyersAlgorithm());\n  }\n\n  public ContractComparator(String source, String dest, CompareAlgorithm algorithm) {\n    this.source = source;\n    this.dest = dest;\n    this.algorithm = algorithm;\n    this.comparisonList = compare();\n  }\n\n  public void setAlgorithm(CompareAlgorithm algorithm) {\n    this.algorithm = algorithm;\n  }\n\n  public CompareAlgorithm getAlgorithm() {\n    return algorithm;\n  }\n\n  public List<Comparison> compare() {\n    return algorithm.compare(source, dest);\n  }\n\n  public boolean equals() {\n    if (comparisonList.size() > 0) {\n      return false;\n    } else {\n      return true;\n    }\n  }\n\n  public void splitPrintToScreen() {\n    splitPrint(System.out);\n  }\n\n  public void splitPrint(OutputStream outputStream) {\n    try {\n      new SplitDiffFormatter(outputStream).format(comparisonList, source, dest);\n    } catch (IOException e) {\n      LOGGER.error(e.getMessage());\n    }\n  }\n}\n"
  },
  {
    "path": "common/src/main/java/org/apache/servicecomb/toolkit/common/ContractFileType.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\nimport java.util.Objects;\n\npublic enum ContractFileType {\n\n  YAML(\".yaml\");\n\n  private String suffix;\n\n  ContractFileType(String suffix) {\n    this.suffix = suffix;\n  }\n\n  public String getFileSuffix() {\n    return this.suffix;\n  }\n\n  public static ContractFileType getValue(String name) {\n\n    name = Objects.requireNonNull(name).toUpperCase();\n    return valueOf(name);\n  }\n}\n"
  },
  {
    "path": "common/src/main/java/org/apache/servicecomb/toolkit/common/DocumentType.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\npublic enum DocumentType {\n  HTML\n}\n"
  },
  {
    "path": "common/src/main/java/org/apache/servicecomb/toolkit/common/FileUtils.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.FileVisitResult;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.nio.file.SimpleFileVisitor;\nimport java.nio.file.attribute.BasicFileAttributes;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\n\npublic class FileUtils {\n\n  public static void createDirectory(String pathName) throws IOException {\n\n    if (pathName == null) {\n      throw new IOException(\"Path is null\");\n    }\n\n    File path = new File(pathName);\n    if (path.exists()) {\n      return;\n    }\n\n    if (!path.mkdirs()) {\n      throw new IOException(\"Failed to create directory\");\n    }\n  }\n\n  public static Path createTempDirectory(String pathName) throws IOException {\n\n    createDirectory((pathName));\n\n    return Files.createTempDirectory(Paths.get(new File(pathName).toURI()), \"\");\n  }\n\n  public static Map<String, byte[]> getFilesGroupByFilename(String pathName) throws IOException {\n\n    if (pathName == null) {\n      throw new IOException(\"Path is null\");\n    }\n\n    if (!new File(pathName).exists()) {\n      throw new IOException(\"Path \" + pathName + \" is not exists\");\n    }\n\n    Map<String, byte[]> filesGroup = new HashMap<>();\n    File path = new File(pathName);\n\n    Files.walkFileTree(Paths.get(path.toURI()), new SimpleFileVisitor<Path>() {\n      @Override\n      public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n        filesGroup.put(file.toFile().getName(), Files.readAllBytes(file));\n        return super.visitFile(file, attrs);\n      }\n    });\n\n    return filesGroup;\n  }\n\n  public static void deleteDirectory(String pathName) throws IOException {\n\n    File path = new File(pathName);\n\n    if (!path.isDirectory()) {\n      if(path.exists()){\n        Files.delete(Paths.get(pathName));\n      }\n      return;\n    }\n\n    File[] files = path.listFiles();\n\n    for (File file : Objects.requireNonNull(files)) {\n      deleteDirectory(file.getCanonicalPath());\n    }\n\n    Files.delete(Paths.get(pathName));\n  }\n}\n"
  },
  {
    "path": "common/src/main/java/org/apache/servicecomb/toolkit/common/ImmediateClassLoader.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\nimport java.io.File;\nimport java.net.URL;\nimport java.net.URLClassLoader;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic class ImmediateClassLoader extends URLClassLoader {\n\n  private final static Logger LOGGER = LoggerFactory.getLogger(ImmediateClassLoader.class);\n\n  private String classPath;\n\n  public ImmediateClassLoader(URL[] urls, ClassLoader parent) {\n    super(urls, parent);\n    for (URL url : urls) {\n      if (url != null) {\n        File file = new File(url.getPath());\n        classPath = file.getAbsolutePath();\n        scanClassFile(file);\n      }\n    }\n  }\n\n  private void scanClassFile(File file) {\n    if (file.exists()) {\n      if (file.isFile() && file.getName().endsWith(\".class\")) {\n        try {\n          String className = file.getAbsolutePath().replace(classPath + File.separator, \"\")\n              .replace(File.separator, \".\")\n              .replace(\".class\", \"\");\n          loadClass(className);\n        } catch (ClassNotFoundException e) {\n          LOGGER.error(e.getMessage());\n        }\n      } else if (file.isDirectory()) {\n        for (File f : file.listFiles()) {\n          scanClassFile(f);\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "common/src/main/java/org/apache/servicecomb/toolkit/common/MyersAlgorithm.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.eclipse.jgit.diff.EditList;\nimport org.eclipse.jgit.diff.MyersDiff;\nimport org.eclipse.jgit.diff.RawText;\nimport org.eclipse.jgit.diff.RawTextComparator;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic class MyersAlgorithm implements CompareAlgorithm {\n\n  private static final Logger LOGGER = LoggerFactory.getLogger(MyersAlgorithm.class);\n\n  @Override\n  public List<Comparison> compare(String source, String dest) {\n\n    if ((source == null) || (dest == null)) {\n      LOGGER.error(\"Source is {} and dest is {}\", source, dest);\n      throw new RuntimeException(\"Source and dest must not be null\");\n    }\n\n    EditList diffList = new EditList();\n    diffList.addAll(MyersDiff.INSTANCE.diff(RawTextComparator.DEFAULT,\n        new RawText(source.getBytes()), new RawText(dest.getBytes())));\n\n    List<Comparison> comparisonList = new ArrayList<>();\n\n    diffList.stream().forEachOrdered(edit -> {\n      ComparisionType comparisionType;\n      switch (edit.getType()) {\n        case INSERT:\n          comparisionType = ComparisionType.INSERT;\n          break;\n        case DELETE:\n          comparisionType = ComparisionType.DELETE;\n          break;\n        case REPLACE:\n          comparisionType = ComparisionType.REPLACE;\n          break;\n        default:\n          comparisionType = ComparisionType.EQUAL;\n          break;\n      }\n      comparisonList\n          .add(new Comparison(comparisionType, edit.getBeginA(), edit.getEndA(), edit.getBeginB(), edit.getEndB()));\n    });\n    return comparisonList;\n  }\n}\n"
  },
  {
    "path": "common/src/main/java/org/apache/servicecomb/toolkit/common/SourceType.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\npublic enum SourceType {\n  CODE,\n  CONTRACT\n}\n"
  },
  {
    "path": "common/src/main/java/org/apache/servicecomb/toolkit/common/SplitDiffFormatter.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\nimport java.io.IOException;\nimport java.io.OutputStream;\nimport java.util.Arrays;\nimport java.util.List;\n\nimport org.eclipse.jgit.diff.DiffFormatter;\n\npublic class SplitDiffFormatter extends DiffFormatter {\n\n  private int radius = 3;\n\n  private final OutputStream out;\n\n  private static final String noNewLine = \"\\nthis is end of compare\\n\";\n\n  private static String outputFormat = \"%-20s\";\n\n  private static String numberFormat = \"%-4s\";\n\n  public SplitDiffFormatter(OutputStream out) {\n    super(out);\n    this.out = out;\n  }\n\n  public void format(List<Comparison> comparisons, String source, String dest) throws IOException {\n\n    outputFormat = \"%-\" + (getMaxLineSize(source) + 10) + \"s\";\n\n    List<String> sourceLines = readStringAsLines(source);\n    List<String> destLines = readStringAsLines(dest);\n\n    for (int currentIndex = 0; currentIndex < comparisons.size(); ) {\n      Comparison currentComparison = comparisons.get(currentIndex);\n      final int endIndex = findOutputEndIndex(comparisons, currentIndex);\n      final Comparison endComparison = comparisons.get(endIndex);\n\n      int originalBegin = (int) Math.max(0, (long) currentComparison.originalPointBegin - radius);\n      int destinationBegin = (int) Math.max(0, (long) currentComparison.destinationPointBegin - radius);\n      int originalEnd = (int) Math.min(sourceLines.size(), (long) endComparison.originalPointEnd + radius);\n      int destinationEnd = (int) Math.min(destLines.size(), (long) endComparison.destinationPointEnd + radius);\n\n      writeHunkHeader(originalBegin, originalEnd, destinationBegin, destinationEnd);\n\n      while (originalBegin < originalEnd || destinationBegin < destinationEnd) {\n\n        if (originalBegin < currentComparison.originalPointBegin || endIndex + 1 < currentIndex) {\n          writeContextLine(sourceLines, originalBegin, destLines, destinationBegin);\n          originalBegin++;\n          destinationBegin++;\n        } else if (originalBegin < currentComparison.originalPointEnd) {\n\n          if (destinationBegin < currentComparison.destinationPointEnd) {\n            writeReplaceLine(sourceLines, originalBegin, destLines, destinationBegin);\n            destinationBegin++;\n          } else {\n            writeRemovedLine(sourceLines, originalBegin, destLines, destinationBegin);\n          }\n          originalBegin++;\n        } else if (destinationBegin < currentComparison.destinationPointEnd) {\n\n          writeAddedLine(sourceLines, originalBegin, destLines, destinationBegin);\n          destinationBegin++;\n        }\n\n        if (end(currentComparison, originalBegin, destinationBegin) && ++currentIndex < comparisons.size()) {\n          currentComparison = comparisons.get(currentIndex);\n        }\n      }\n\n      writeLine(noNewLine);\n    }\n  }\n\n  public int getMaxLineSize(String text) {\n    final int[] maxLen = {0};\n    readStringAsLines(text).forEach(line -> {\n      int temp = line.length();\n      if (temp > maxLen[0]) {\n        maxLen[0] = temp;\n      }\n    });\n    return maxLen[0];\n  }\n\n  private List<String> readStringAsLines(String text) {\n    return Arrays.asList(text.split(\"\\\\r?\\\\n\"));\n  }\n\n  protected void writeReplaceLine(List<String> text, int line, List<String> textB, int bCur) throws IOException {\n    writeLine(buildFormatLineLeft(text, line, \" -\") + buildFormatLineRight(textB, bCur, \" +\") + \"\\n\");\n  }\n\n  protected void writeContextLine(List<String> text, int line, List<String> textB, int bCur) throws IOException {\n    writeLine(buildFormatLineLeft(text, line, \"  \") + buildFormatLineRight(textB, bCur, \"  \") + \"\\n\");\n  }\n\n  protected void writeRemovedLine(List<String> text, int line, List<String> textB, int bCur) throws IOException {\n    writeLine(buildFormatLineLeft(text, line, \" -\") + \"\\n\");\n  }\n\n  protected void writeAddedLine(List<String> text, int line, List<String> textB, int bCur) throws IOException {\n    writeLine(\n        String.format(numberFormat, \" \") + String.format(outputFormat, \" \") + buildFormatLineRight(textB, bCur, \" +\")\n            + \"\\n\");\n  }\n\n  protected void writeLine(final String content) throws IOException {\n    out.write(content.getBytes());\n  }\n\n  private String buildFormatLineLeft(List<String> text, int line, String prefix) {\n    return String.format(numberFormat, (line + 1)) + String.format(outputFormat, prefix + text.get(line));\n  }\n\n  private String buildFormatLineRight(List<String> text, int line, String prefix) {\n    return String.format(numberFormat, (line + 1)) + String\n        .format(getOutputFormat(text.get(line).length()), prefix + text.get(line));\n  }\n\n  private String getOutputFormat(int len) {\n    return \"%-\" + len + \"s\";\n  }\n\n  private static boolean end(Comparison edit, int a, int b) {\n    return edit.originalPointEnd <= a && edit.destinationPointEnd <= b;\n  }\n\n  private int findOutputEndIndex(List<Comparison> edits, int i) {\n    int end = i + 1;\n    while (end < edits.size()\n        && (isOriginalEnd(edits, end) || isDestinationEnd(edits, end))) {\n      end++;\n    }\n    return end - 1;\n  }\n\n  private boolean isOriginalEnd(List<Comparison> e, int i) {\n    return e.get(i).originalPointBegin - e.get(i - 1).originalPointEnd <= 2 * radius;\n  }\n\n  private boolean isDestinationEnd(List<Comparison> e, int i) {\n    return e.get(i).destinationPointBegin - e.get(i - 1).destinationPointEnd <= 2 * radius;\n  }\n}\n"
  },
  {
    "path": "common/src/test/java/org/apache/servicecomb/toolkit/common/ClassMakerTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.concurrent.TimeoutException;\n\nimport org.hamcrest.core.StringContains;\nimport org.junit.Assert;\nimport org.junit.Test;\n\npublic class ClassMakerTest {\n\n  private static final String testResourceDirectory =\n      \".\" + File.separator + \"src\" + File.separator + \"test\" + File.separator + \"resources\";\n\n  @Test\n  public void runWithCorrectMavenProjectPath() throws InterruptedException, TimeoutException, IOException {\n\n    String projectPath =\n        testResourceDirectory + File.separator + \"projects\" + File.separator + \"demo-with-correct-pom\" + File.separator;\n    ClassMaker.compile(projectPath);\n    Assert.assertTrue(new File(projectPath + \"target\").exists());\n  }\n\n  @Test\n  public void runWithInvalidMavenProjectPath() throws InterruptedException, TimeoutException, IOException {\n\n    String projectPath =\n        testResourceDirectory + File.separator + \"projects\" + File.separator + \"demo-with-invalid-pom\" + File.separator;\n\n    try {\n      ClassMaker.compile(projectPath);\n      Assert.fail(\"Run 'runWithInvalidMavenProjectPath' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      Assert.assertThat(e.getMessage(), StringContains.containsString(\"Command exec fail\"));\n      return;\n    }\n  }\n}\n"
  },
  {
    "path": "common/src/test/java/org/apache/servicecomb/toolkit/common/FileUtilsTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\nimport static org.hamcrest.CoreMatchers.containsString;\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertThat;\nimport static org.junit.Assert.fail;\n\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\n\nimport org.junit.Test;\n\npublic class FileUtilsTest {\n\n  @Test\n  public void createDirectoryTest() {\n    Path path;\n    try {\n      path = Files.createTempDirectory(\"\");\n      FileUtils.createDirectory(path.toFile().getCanonicalPath());\n    } catch (IOException e) {\n      fail(\"Run 'createDirectoryTest' failed, unexpected to catch IOException: \" + e.getMessage());\n    }\n\n    try {\n      FileUtils.createDirectory(null);\n      fail(\"Run 'createDirectoryTest' failed, expected to occur IOException but not\");\n    } catch (IOException e) {\n      assertEquals(\"Path is null\", e.getMessage());\n    }\n  }\n\n  @Test\n  public void getFilesGroupByFilenameTest() {\n\n    try {\n      FileUtils.getFilesGroupByFilename(null);\n      fail(\"Run 'getFilesGroupByFilenameTest' failed, expected to occur IOException but not\");\n    } catch (IOException e) {\n      assertEquals(\"Path is null\", e.getMessage());\n    }\n\n    try {\n      FileUtils.getFilesGroupByFilename(\"\");\n      fail(\"Run 'getFilesGroupByFilenameTest' failed, expected to occur IOException but not\");\n    } catch (IOException e) {\n      assertThat(e.getMessage(), containsString(\"is not exists\"));\n    }\n  }\n}"
  },
  {
    "path": "common/src/test/java/org/apache/servicecomb/toolkit/common/TextCompareTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.common;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertTrue;\nimport static org.mockito.ArgumentMatchers.anyString;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.regex.Pattern;\n\nimport org.junit.Test;\nimport org.mockito.invocation.InvocationOnMock;\nimport org.mockito.stubbing.Answer;\n\npublic class TextCompareTest {\n\n  Path sourcePath = Paths.get(\"./src/test/resources/compare/HelloEndPoint.yaml\");\n\n  Path destPath = Paths.get(\"./src/test/resources/compare/HelloEndPoint2.yaml\");\n\n  @Test\n  public void testContractCompareText() throws IOException {\n    ContractComparator contractComparator = new ContractComparator(new String(Files.readAllBytes(sourcePath)),\n        new String(Files.readAllBytes(destPath)));\n    assertEquals(MyersAlgorithm.class, contractComparator.getAlgorithm().getClass());\n\n    List<Comparison> comparisonList = contractComparator.compare();\n\n    assertEquals(3, comparisonList.size());\n  }\n\n  @Test\n  public void testContractCompareResultPrint() throws IOException {\n    ContractComparator contractComparator = new ContractComparator(new String(Files.readAllBytes(sourcePath)),\n        new String(Files.readAllBytes(destPath)));\n    assertEquals(MyersAlgorithm.class, contractComparator.getAlgorithm().getClass());\n\n    ByteArrayOutputStream bout = new ByteArrayOutputStream();\n    contractComparator.splitPrint(bout);\n\n    assertTrue(0 < bout.toByteArray().length);\n  }\n\n  @Test\n  public void testContractCompareAnotherAlgorithm() throws IOException {\n\n    CompareAlgorithm oneLineAlgorithm = mock(CompareAlgorithm.class);\n    when(oneLineAlgorithm.compare(anyString(), anyString())).then(new Answer<Object>() {\n      @Override\n      public Object answer(InvocationOnMock invocationOnMock) throws Throwable {\n        Object[] args = invocationOnMock.getArguments();\n        String source = (String) args[0];\n        String dest = (String) args[1];\n        if ((source == null || \"\".equals(source.trim())) && dest != null) {\n          Comparison comparison = new Comparison(ComparisionType.INSERT, 0, 0, 1, 0);\n          return Collections.singletonList(comparison);\n        }\n\n        if (source != null && (dest == null || \"\".equals(dest.trim()))) {\n          Comparison comparison = new Comparison(ComparisionType.DELETE, 0, 0, 0, 0);\n          return Collections.singletonList(comparison);\n        }\n\n        if (hasNewLine(source) || hasNewLine(dest)) {\n          return null;\n        }\n\n        if ((dest).equals(source)) {\n          return Collections.singletonList(new Comparison(ComparisionType.EQUAL, 0, 0, 0, 0));\n        }\n        Comparison comparison = new Comparison(ComparisionType.REPLACE, 0, 1, 0, 1);\n        return Collections.singletonList(comparison);\n      }\n    });\n\n    ContractComparator contractComparator = new ContractComparator(\"source line\",\n        \"destination line\", oneLineAlgorithm);\n\n    ByteArrayOutputStream bout = new ByteArrayOutputStream();\n    contractComparator.splitPrint(bout);\n    bout.flush();\n    assertTrue(0 < bout.toByteArray().length);\n\n    bout = new ByteArrayOutputStream();\n    contractComparator = new ContractComparator(\"source line\",\n        \"source line\", oneLineAlgorithm);\n    contractComparator.splitPrint(bout);\n    assertEquals(ComparisionType.EQUAL, contractComparator.compare().get(0).type);\n  }\n\n  private boolean hasNewLine(String s) {\n    return Pattern.compile(\"\\\\r?\\\\n\").matcher(s).find();\n  }\n\n  @Test\n  public void testContractCompareException() throws IOException {\n\n    try (ByteArrayOutputStream bout = new ByteArrayOutputStream()) {\n\n      ContractComparator contractComparator = new ContractComparator(null,\n          new String(Files.readAllBytes(destPath)));\n      assertEquals(MyersAlgorithm.class, contractComparator.getAlgorithm().getClass());\n      contractComparator.splitPrint(bout);\n    } catch (RuntimeException e) {\n      assertEquals(\"Source and dest must not be null\", e.getMessage());\n    }\n  }\n}\n"
  },
  {
    "path": "common/src/test/resources/compare/HelloEndPoint.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n---\nswagger: \"2.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"swagger definition for HelloEndPoint\"\n  x-java-interface: \"gen.swagger.HelloEndPointIntf\"\nbasePath: \"/hello\"\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\npaths:\n  /sayHello:\n    get:\n      operationId: \"sayHello\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      - name: \"result\"\n        in: \"query\"\n        required: false\n        type: \"number\"\n        format: \"double\"\n      - name: \"instanceId\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      - name: \"callTime\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n  /sayHi:\n    get:\n      operationId: \"sayHi\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      - name: \"Authorization\"\n        in: \"header\"\n        description: \"aa\"\n        required: true\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n"
  },
  {
    "path": "common/src/test/resources/compare/HelloEndPoint2.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n---\nswagger: \"2.0\"\ninfo:\n  version: \"1.0.1\"\n  title: \"swagger definition for HelloEndPoint\"\n  x-java-interface: \"gen.swagger.HelloEndPointIntf\"\nbasePath: \"/hello\"\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\npaths:\n  /sayHello:\n    get:\n      operationId: \"sayHello\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      - name: \"result\"\n        in: \"query\"\n        required: false\n        type: \"number\"\n        format: \"int\"\n      - name: \"instanceId\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      - name: \"callTime\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n  /sayHi:\n    get:\n      operationId: \"sayHi\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      - name: \"Authorization\"\n        in: \"header\"\n        description: \"abc\"\n        required: true\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n"
  },
  {
    "path": "common/src/test/resources/projects/demo-with-correct-pom/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>org.apache.servicecomb.toolkit</groupId>\n  <artifactId>demo-with-correct-pom</artifactId>\n  <version>1</version>\n  <packaging>jar</packaging>\n</project>"
  },
  {
    "path": "common/src/test/resources/projects/demo-with-invaild-pom/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>org.apache.servicecomb.toolkit</groupId>\n  <artifactId>demo-with-correct-pom</artifactId>\n  <version>1</version>\n  <packaging>jar</packaging>\n\n  invalid content\n\n</project>"
  },
  {
    "path": "contractgen/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>toolkit</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>contractgen</artifactId>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>common</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-generator-jaxrs</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-generator-spring</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-generator-servicecomb</artifactId>\n    </dependency>\n    \n    <dependency>\n      <groupId>junit</groupId>\n      <artifactId>junit</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.mockito</groupId>\n      <artifactId>mockito-core</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.maven</groupId>\n      <artifactId>maven-core</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.maven.plugin-testing</groupId>\n      <artifactId>maven-plugin-testing-harness</artifactId>\n      <scope>test</scope>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "contractgen/src/main/java/org/apache/servicecomb/toolkit/contractgen/DefaultContractsGenerator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.contractgen;\n\nimport static org.apache.servicecomb.toolkit.common.ContractFileType.YAML;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.lang.reflect.Field;\nimport java.net.MalformedURLException;\nimport java.net.URL;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Vector;\n\nimport javax.ws.rs.Path;\n\nimport org.apache.servicecomb.provider.pojo.RpcSchema;\nimport org.apache.servicecomb.provider.rest.common.RestSchema;\nimport org.apache.servicecomb.toolkit.ContractsGenerator;\nimport org.apache.servicecomb.toolkit.common.ContractFileType;\nimport org.apache.servicecomb.toolkit.common.ImmediateClassLoader;\nimport org.apache.servicecomb.toolkit.generator.context.OasGenerator;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\nimport io.swagger.v3.core.util.Yaml;\nimport io.swagger.v3.oas.models.OpenAPI;\n\npublic class DefaultContractsGenerator implements ContractsGenerator {\n\n  private static Logger LOGGER = LoggerFactory.getLogger(DefaultContractsGenerator.class);\n\n  private Map<String, Object> config;\n\n  private List<String> classpathUrls;\n\n  private String outputDir = \".\";\n\n  private ContractFileType contractfileType = YAML;\n\n  @Override\n  public boolean canProcess(String type) {\n    return \"default\".equals(type);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Override\n  public void configure(Map<String, Object> config) {\n    this.config = config;\n\n    if (config == null) {\n      return;\n    }\n\n    Object classpathUrlsObj = config.get(\"classpathUrls\");\n    if (classpathUrlsObj instanceof List) {\n      classpathUrls = (List<String>) classpathUrlsObj;\n    }\n\n    Object outputDirObj = config.get(\"outputDir\");\n    if (outputDirObj instanceof String) {\n      outputDir = (String) outputDirObj;\n    }\n\n    Object contractFileTypeObj = config.get(\"contractFileType\");\n    if (contractFileTypeObj instanceof String) {\n      contractfileType = ContractFileType.getValue((String) contractFileTypeObj);\n    }\n  }\n\n  @SuppressWarnings(\"ResultOfMethodCallIgnored\")\n  @Override\n  public void generate() throws RuntimeException {\n\n    URL[] runtimeUrls = new URL[classpathUrls.size()];\n    for (int i = 0; i < classpathUrls.size(); i++) {\n\n      String element = classpathUrls.get(i);\n\n      try {\n        runtimeUrls[i] = new File(element).toURI().toURL();\n      } catch (MalformedURLException e) {\n        throw new RuntimeException(\"Wrong element in classpath\", e);\n      }\n    }\n\n    if (!checkConfig()) {\n      throw new IllegalArgumentException(\"Cannot found configuration\");\n    }\n\n    ImmediateClassLoader immediateClassLoader = new ImmediateClassLoader(runtimeUrls,\n        Thread.currentThread().getContextClassLoader());\n\n    try {\n\n      Vector allClass = getAllClass(immediateClassLoader);\n\n      for (int i = 0; i < allClass.size(); i++) {\n\n        Class loadClass = (Class) allClass.get(i);\n        if (!canProcess(loadClass)) {\n          continue;\n        }\n\n        OasGenerator oasGenerator = new OasGenerator();\n        OpenAPI oas = oasGenerator.generate(loadClass);\n\n        if (oas == null) {\n          continue;\n        }\n\n        String oasPretty = Yaml.pretty(oas);\n\n        File outputFile = new File(\n            outputDir + File.separator + loadClass.getSimpleName() + contractfileType\n                .getFileSuffix());\n\n        if (!outputFile.exists()) {\n          if (!outputFile.getParentFile().exists()) {\n            outputFile.getParentFile().mkdirs();\n          }\n          outputFile.createNewFile();\n        }\n\n        Files.write(Paths.get(outputFile.toURI()), oasPretty.getBytes());\n      }\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  private boolean checkConfig() {\n    return config != null && classpathUrls != null;\n  }\n\n  private static boolean canProcess(Class<?> loadClass) {\n\n    if (loadClass == null) {\n      return false;\n    }\n    RestSchema restSchema = loadClass.getAnnotation(RestSchema.class);\n    if (restSchema != null) {\n      return true;\n    }\n\n    RestController controller = loadClass.getAnnotation(RestController.class);\n    if (controller != null) {\n      return true;\n    }\n\n    RpcSchema rpcSchema = loadClass.getAnnotation(RpcSchema.class);\n    if (rpcSchema != null) {\n      return true;\n    }\n\n    RequestMapping requestMapping = loadClass.getAnnotation(RequestMapping.class);\n    if (requestMapping != null) {\n      return true;\n    }\n\n    Path pathAnnotation = loadClass.getAnnotation(Path.class);\n    if (pathAnnotation != null) {\n      return true;\n    }\n    return false;\n  }\n\n  private static Vector getAllClass(ClassLoader classLoader) {\n    Field classesField;\n    try {\n      classesField = ClassLoader.class.getDeclaredField(\"classes\");\n      classesField.setAccessible(true);\n\n      if (classesField.get(classLoader) instanceof Vector) {\n        return (Vector) classesField.get(classLoader);\n      }\n    } catch (Exception e) {\n      throw new RuntimeException(\"Cannot get class from ClassLoader \" + classLoader.getClass());\n    }\n    return new Vector<>();\n  }\n}\n"
  },
  {
    "path": "contractgen/src/main/resources/META-INF/services/org.apache.servicecomb.toolkit.ContractsGenerator",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\norg.apache.servicecomb.toolkit.contractgen.DefaultContractsGenerator"
  },
  {
    "path": "contractgen/src/test/java/org/apache/servicecomb/toolkit/contractgen/ContractTestUtil.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.contractgen;\n\nimport javassist.ClassPool;\nimport javassist.CtClass;\nimport javassist.bytecode.AnnotationsAttribute;\nimport javassist.bytecode.ConstPool;\nimport javassist.bytecode.annotation.Annotation;\n\npublic class ContractTestUtil {\n\n  public CtClass createCtClass(String className) throws Exception {\n\n    ClassPool pool = ClassPool.getDefault();\n\n    return pool.makeClass(\"org.apache.servicecomb.toolkit.contractgen.test.\" + className);\n  }\n\n  public Class putAnnotationToClass(String className, Class annotationClass) throws Exception {\n\n    CtClass ctClass = createCtClass(className);\n\n    ConstPool constPool = ctClass.getClassFile().getConstPool();\n\n    AnnotationsAttribute requestMappingAnnotationAttr = new AnnotationsAttribute(constPool,\n        AnnotationsAttribute.visibleTag);\n    Annotation requestMapping = new Annotation(annotationClass.getName(), constPool);\n\n    requestMappingAnnotationAttr.addAnnotation(requestMapping);\n    ctClass.getClassFile().addAttribute(requestMappingAnnotationAttr);\n\n    return ctClass.toClass();\n  }\n}\n"
  },
  {
    "path": "contractgen/src/test/java/org/apache/servicecomb/toolkit/contractgen/DefaultContractsGeneratorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.contractgen;\n\nimport static org.hamcrest.core.Is.is;\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertNotNull;\nimport static org.junit.Assert.assertNull;\nimport static org.junit.Assert.assertThat;\nimport static org.junit.Assert.assertTrue;\nimport static org.junit.Assert.fail;\nimport static org.mockito.BDDMockito.given;\nimport static org.mockito.Mockito.mock;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.lang.reflect.InvocationTargetException;\nimport java.lang.reflect.Method;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.concurrent.TimeoutException;\n\nimport javax.ws.rs.Path;\nimport org.apache.maven.artifact.DependencyResolutionRequiredException;\nimport org.apache.maven.plugin.testing.resources.TestResources;\nimport org.apache.maven.project.MavenProject;\nimport org.apache.servicecomb.provider.pojo.RpcSchema;\nimport org.apache.servicecomb.provider.rest.common.RestSchema;\nimport org.apache.servicecomb.toolkit.ContractsGenerator;\nimport org.apache.servicecomb.toolkit.GeneratorFactory;\nimport org.apache.servicecomb.toolkit.common.ClassMaker;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\nimport javassist.CtClass;\n\npublic class DefaultContractsGeneratorTest {\n\n  @Rule\n  public TestResources resources = new TestResources();\n\n  private static final String TEST_PROJECT = \"demo\";\n\n  @Test\n  public void testCanProcess() {\n    assertTrue(new DefaultContractsGenerator().canProcess(\"default\"));\n    assertFalse(new DefaultContractsGenerator().canProcess(\"others\"));\n  }\n\n  @Test\n  public void testConfigure() throws DependencyResolutionRequiredException {\n    Map<String, Object> config = new HashMap<>();\n\n    MavenProject project = new MavenProject();\n    config.put(\"classpathUrls\", project.getRuntimeClasspathElements());\n    config.put(\"outputDir\", \"target\");\n    config.put(\"contractfileType\", \"yaml\");\n  }\n\n  @Test\n  public void testGenerate()\n      throws DependencyResolutionRequiredException, IOException, TimeoutException, InterruptedException {\n\n    File demoPath = this.resources.getBasedir(TEST_PROJECT);\n    ClassMaker.compile(demoPath.getCanonicalPath());\n    MavenProject project = mock(MavenProject.class);\n\n    List<String> runtimeUrlPath = new ArrayList<>();\n    runtimeUrlPath.add(demoPath + File.separator + \"target/classes\");\n\n    Map<String, Object> config = new HashMap<>();\n    given(project.getRuntimeClasspathElements()).willReturn(runtimeUrlPath);\n    config.put(\"classpathUrls\", project.getRuntimeClasspathElements());\n    config.put(\"outputDir\", \"target\");\n    config.put(\"contractfileType\", \"yaml\");\n\n    DefaultContractsGenerator defaultContractsGenerator = new DefaultContractsGenerator();\n    defaultContractsGenerator.configure(config);\n    try {\n      defaultContractsGenerator.generate();\n    } catch (RuntimeException e) {\n      fail(\"Run 'testGenerate' failed and unexpected to catch RuntimeException: \" + e.getMessage());\n    }\n  }\n\n  @Test\n  public void testCheckConfig() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException,\n      DependencyResolutionRequiredException {\n    DefaultContractsGenerator defaultContractsGenerator = new DefaultContractsGenerator();\n    Method method = defaultContractsGenerator.getClass().getDeclaredMethod(\"checkConfig\", new Class[] {});\n    method.setAccessible(true);\n\n    defaultContractsGenerator.configure(null);\n    assertThat(method.invoke(defaultContractsGenerator), is(false));\n\n    Map<String, Object> config = new HashMap<>();\n    config.put(\"classpathUrls\", null);\n    defaultContractsGenerator.configure(config);\n    assertThat(method.invoke(defaultContractsGenerator), is(false));\n\n    MavenProject project = new MavenProject();\n    config.put(\"classpathUrls\", project.getRuntimeClasspathElements());\n    defaultContractsGenerator.configure(config);\n    assertThat(method.invoke(defaultContractsGenerator), is(true));\n  }\n\n  @Test\n  public void testPrivateCanProcess() throws Exception {\n    DefaultContractsGenerator defaultContractsGenerator = new DefaultContractsGenerator();\n    Method method = defaultContractsGenerator.getClass().getDeclaredMethod(\"canProcess\", Class.class);\n    method.setAccessible(true);\n\n    assertThat(method.invoke(defaultContractsGenerator, new Object[] {null}), is(false));\n\n    Class mockClass;\n    ContractTestUtil contractTestUtil = new ContractTestUtil();\n\n    CtClass ctClass = contractTestUtil.createCtClass(\"TestCanProcess\");\n    assertThat(method.invoke(\"TestCanProcess\", ctClass.toClass()), is(false));\n\n    mockClass = contractTestUtil.putAnnotationToClass(\"TestRestSchema\", RestSchema.class);\n    assertThat(method.invoke(\"TestRestSchema\", mockClass), is(true));\n\n    mockClass = contractTestUtil.putAnnotationToClass(\"TestRestController\", RestController.class);\n    assertThat(method.invoke(\"TestRestController\", mockClass), is(true));\n\n    mockClass = contractTestUtil.putAnnotationToClass(\"TestRpcSchema\", RpcSchema.class);\n    assertThat(method.invoke(\"TestRpcSchema\", mockClass), is(true));\n\n    mockClass = contractTestUtil.putAnnotationToClass(\"TestRequestMapping\", RequestMapping.class);\n    assertThat(method.invoke(\"TestRequestMapping\", mockClass), is(true));\n\n    mockClass = contractTestUtil.putAnnotationToClass(\"TestPath\", Path.class);\n    assertThat(method.invoke(\"TestPath\", mockClass), is(true));\n  }\n\n  @Test\n  public void testgetAllClass() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {\n    DefaultContractsGenerator defaultContractsGenerator = new DefaultContractsGenerator();\n    Method method = defaultContractsGenerator.getClass()\n        .getDeclaredMethod(\"getAllClass\", ClassLoader.class);\n    method.setAccessible(true);\n\n    try {\n      method.invoke(defaultContractsGenerator, new Object[] {null});\n    } catch (Exception e) {\n      assertTrue(true);\n      return;\n    }\n\n    fail(\"Run 'testgetAllClass' failed, expected to catch Exception but not\");\n  }\n\n  @Test\n  public void testGetContractsGeneratorInstance() {\n\n    ContractsGenerator defaultGenerator = GeneratorFactory.getGenerator(ContractsGenerator.class, \"default\");\n    assertNotNull(defaultGenerator);\n\n    ContractsGenerator unknownGenerator = GeneratorFactory.getGenerator(ContractsGenerator.class, \"unknown\");\n    assertNull(unknownGenerator);\n  }\n}"
  },
  {
    "path": "contractgen/src/test/projects/demo/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>org.apache.servicecomb.toolkit</groupId>\n  <artifactId>demo</artifactId>\n  <version>0.3.0-SNAPSHOT</version>\n  <name>demo-contractgen-test</name>\n  <packaging>jar</packaging>\n\n  <parent>\n    <groupId>org.springframework.boot</groupId>\n    <artifactId>spring-boot-starter-parent</artifactId>\n    <version>1.5.12.RELEASE</version>\n    <relativePath/> <!-- lookup parent from repository -->\n  </parent>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-web</artifactId>\n    </dependency>\n\n  </dependencies>\n\n</project>"
  },
  {
    "path": "contractgen/src/test/projects/demo/src/main/java/demo/Application.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage demo;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\npublic class Application {\n  public Application() {\n  }\n\n  public static void main(String[] args) {\n    SpringApplication.run(Application.class, args);\n  }\n}\n"
  },
  {
    "path": "contractgen/src/test/projects/demo/src/main/java/demo/HelloEndPoint.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage demo;\n\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n@RestController\n@RequestMapping({\"/hello\"})\npublic class HelloEndPoint {\n  public HelloEndPoint() {\n  }\n\n  @GetMapping({\"/sayHello\"})\n  public String sayHello(String name) {\n    return \"Hello, \" + name;\n  }\n\n  @GetMapping({\"/sayHi\"})\n  public String sayHi(String name) {\n    return \"Hi, \" + name;\n  }\n}\n"
  },
  {
    "path": "contractgen/src/test/resources/log4j2-test.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!--this is sample configuration, please modify as your wish-->\n\n<configuration>\n  <Appenders>\n    <Console name=\"Console\" target=\"SYSTEM_OUT\">\n      <PatternLayout pattern=\"%m%n\"/>\n    </Console>\n  </Appenders>\n  <Loggers>\n    <Root level=\"info\">\n      <AppenderRef ref=\"Console\"/>\n    </Root>\n    <Logger name=\"org.openapitools\" additivity=\"false\" level=\"ERROR\">\n      <AppenderRef ref=\"Console\"/>\n    </Logger>\n  </Loggers>\n</configuration>"
  },
  {
    "path": "core/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>toolkit</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>core</artifactId>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.openapitools</groupId>\n      <artifactId>openapi-generator</artifactId>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "core/src/main/java/org/apache/servicecomb/toolkit/CodeGenerator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit;\n\npublic interface CodeGenerator extends Generator {\n}\n"
  },
  {
    "path": "core/src/main/java/org/apache/servicecomb/toolkit/ContractsGenerator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit;\n\npublic interface ContractsGenerator extends Generator {\n}\n"
  },
  {
    "path": "core/src/main/java/org/apache/servicecomb/toolkit/DocGenerator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit;\n\npublic interface DocGenerator extends Generator {\n}\n"
  },
  {
    "path": "core/src/main/java/org/apache/servicecomb/toolkit/Generator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit;\n\nimport java.util.Map;\n\npublic interface Generator {\n\n  boolean canProcess(String type);\n\n  void configure(Map<String, Object> config);\n\n  void generate();\n}\n"
  },
  {
    "path": "core/src/main/java/org/apache/servicecomb/toolkit/GeneratorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.ServiceLoader;\nimport java.util.concurrent.ConcurrentHashMap;\n\npublic class GeneratorFactory {\n\n  private final static Map<String, List> interfaceMap = new ConcurrentHashMap<>();\n\n  static {\n    addGeneratorType(CodeGenerator.class);\n    addGeneratorType(DocGenerator.class);\n    addGeneratorType(ContractsGenerator.class);\n  }\n\n  public static void addGeneratorType(Class<? extends Generator> generatorClass) {\n\n    if (interfaceMap.get(generatorClass.getName()) == null) {\n      interfaceMap.put(generatorClass.getName(), loadInitialCodeGenerators(generatorClass));\n    }\n  }\n\n  private static List<Generator> loadInitialCodeGenerators(Class<? extends Generator> generatorClass) {\n    List<Generator> registeredGenerators = new ArrayList<>();\n    ServiceLoader.load(generatorClass).forEach(registeredGenerators::add);\n    return registeredGenerators;\n  }\n\n  public static <T extends Generator> T getGenerator(Class<? extends T> generatorClass, String type) {\n\n    @SuppressWarnings(\"unchecked\")\n    List<T> registeredList = (List<T>) interfaceMap.get(generatorClass.getName());\n    for (T generator : registeredList) {\n      if (generator.canProcess(type)) {\n        return generator;\n      }\n    }\n\n    return null;\n  }\n}\n"
  },
  {
    "path": "docgen/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>toolkit</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>docgen</artifactId>\n\n  <repositories>\n    <repository>\n      <snapshots>\n        <enabled>false</enabled>\n      </snapshots>\n      <id>jcenter-releases</id>\n      <name>jcenter</name>\n      <url>https://jcenter.bintray.com</url>\n    </repository>\n  </repositories>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>core</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>swagger-generator-core</artifactId>\n      <exclusions>\n        <exclusion>\n          <groupId>org.checkerframework</groupId>\n          <artifactId>checker-compat-qual</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>com.google.guava</groupId>\n          <artifactId>listenablefuture</artifactId>\n        </exclusion>\n      </exclusions>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.commons</groupId>\n      <artifactId>commons-lang3</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>junit</groupId>\n      <artifactId>junit</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n  </dependencies>\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n      </plugin>\n    </plugins>\n  </build>\n</project>\n"
  },
  {
    "path": "docgen/src/main/java/org/apache/servicecomb/toolkit/docgen/ContractsSwaggerUIGenerator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.docgen;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport java.util.Map;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\nimport org.apache.servicecomb.toolkit.DocGenerator;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport io.swagger.v3.core.util.Json;\nimport io.swagger.v3.oas.models.OpenAPI;\n\npublic class ContractsSwaggerUIGenerator implements DocGenerator {\n\n  private final static Logger LOGGER = LoggerFactory.getLogger(ContractsSwaggerUIGenerator.class);\n\n  private static Pattern variablePattern = Pattern.compile(\"(?<=\\\\{\\\\{)[a-zA-Z0-9_-]*(?=\\\\}\\\\})\");\n\n  private final static String DOC_SUFFIX = \".html\";\n\n  private OpenAPI contractContent;\n\n  private String outputPath = \".\";\n\n  @Override\n\n  public boolean canProcess(String type) {\n    return \"default\".equals(type) || \"swagger-ui\".equals(type);\n  }\n\n  @Override\n  public void configure(Map<String, Object> config) {\n    this.contractContent = (OpenAPI) config.get(\"contractContent\");\n    this.outputPath = (String) config.get(\"outputPath\");\n  }\n\n  private boolean checkConfig() {\n    if (contractContent == null) {\n      return false;\n    }\n    return true;\n  }\n\n  @Override\n  public void generate() {\n\n    if (!checkConfig()) {\n      throw new IllegalArgumentException(\"Cannot found configuration\");\n    }\n\n    String swaggerUiHtml = null;\n    try {\n      String swaggerJson = Json.mapper().writeValueAsString(contractContent);\n      swaggerUiHtml = renderHtml(getSwaggerUiHtml(), Collections.singletonMap(\"spec\", swaggerJson));\n\n      outputPath = correctPath(outputPath);\n      Path outputFile = Paths.get(outputPath);\n\n      if (!Files.exists(outputFile)) {\n        if (outputFile.getParent() != null) {\n          Files.createDirectories(outputFile.getParent());\n        }\n        Files.createFile(outputFile);\n      }\n\n      Files.write(outputFile, swaggerUiHtml.getBytes());\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  private String correctPath(String filepath) {\n\n    if (!filepath.endsWith(DOC_SUFFIX)) {\n      return filepath + DOC_SUFFIX;\n    }\n\n    return filepath;\n  }\n\n  private String renderHtml(String html, Map<String, String> args) {\n\n    Matcher variableMatcher = variablePattern.matcher(html);\n    while (variableMatcher.find()) {\n      String variableStr = variableMatcher.group();\n      String variableValue = args.get(variableStr);\n\n      html = html.replace(\"{{\" + variableStr + \"}}\", variableValue);\n    }\n\n    return html;\n  }\n\n  private String getSwaggerUiHtml() throws IOException {\n    int len;\n\n    ByteArrayOutputStream bout = new ByteArrayOutputStream();\n    InputStream in = this.getClass().getClassLoader().getResourceAsStream(\"webroot/swagger-ui.html\");\n\n    byte[] buf = new byte[1024];\n    while ((len = in.read(buf)) != -1) {\n      bout.write(buf, 0, len);\n    }\n    bout.close();\n    in.close();\n\n    return new String(bout.toByteArray());\n  }\n}\n"
  },
  {
    "path": "docgen/src/main/resources/META-INF/services/org.apache.servicecomb.toolkit.DocGenerator",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\norg.apache.servicecomb.toolkit.docgen.ContractsSwaggerUIGenerator"
  },
  {
    "path": "docgen/src/main/resources/webroot/swagger-ui.html",
    "content": "<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\n    <meta charset=\"UTF-8\">\n    <title>Title</title>\n\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"https://unpkg.com/swagger-ui-dist@3.22.1/swagger-ui.css\">\n    <script src=\"https://unpkg.com/swagger-ui-dist@3.22.1/swagger-ui-standalone-preset.js\"></script>\n    <script src=\"https://unpkg.com/swagger-ui-dist@3.22.1/swagger-ui-bundle.js\"></script>\n</head>\n<body>\n\n<div id=\"swagger-ui\"></div>\n\n</body>\n\n\n<script>\n    const ui = SwaggerUIBundle({\n        spec: JSON.parse('{{spec}}'),\n        dom_id: '#swagger-ui',\n        deepLinking: true,\n        presets: [\n            SwaggerUIBundle.presets.apis,\n            SwaggerUIStandalonePreset\n        ],\n        layout: \"StandaloneLayout\"\n    })\n</script>\n\n</html>"
  },
  {
    "path": "docgen/src/test/java/org/apache/servicecomb/toolkit/docgen/ContractsSwaggerUIGeneratorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.docgen;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.servicecomb.toolkit.DocGenerator;\nimport org.apache.servicecomb.toolkit.GeneratorFactory;\nimport org.junit.Assert;\nimport org.junit.Test;\n\nimport io.swagger.parser.OpenAPIParser;\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\n\npublic class ContractsSwaggerUIGeneratorTest {\n\n  @Test\n  public void testContractTransferToSwaggerUI() throws IOException {\n\n    InputStream in = ContractsSwaggerUIGeneratorTest.class.getClassLoader().getResourceAsStream(\"HelloEndPoint.yaml\");\n\n    StringBuilder sb = new StringBuilder();\n    byte[] bytes = new byte[1024];\n    int len = -1;\n    while ((len = in.read(bytes)) != -1) {\n      sb.append(new String(bytes, 0, len));\n    }\n\n    OpenAPIParser openAPIParser = new OpenAPIParser();\n    SwaggerParseResult swaggerParseResult = openAPIParser.readContents(sb.toString(), null, null);\n\n    Path tempDir = Files.createTempDirectory(null);\n    Path outputPath = Paths.get(tempDir.toFile().getAbsolutePath()\n        + File.separator + \"swagger-ui.html\");\n    DocGenerator docGenerator = GeneratorFactory.getGenerator(DocGenerator.class, \"default\");\n    Map<String, Object> docGeneratorConfig = new HashMap<>();\n    docGeneratorConfig.put(\"contractContent\", swaggerParseResult.getOpenAPI());\n    docGeneratorConfig.put(\"outputPath\", outputPath.toFile().getCanonicalPath());\n    Objects.requireNonNull(docGenerator).configure(docGeneratorConfig);\n    docGenerator.generate();\n\n    Assert.assertTrue(Files.exists(outputPath));\n    FileUtils.deleteDirectory(tempDir.toFile());\n  }\n\n  @Test\n  public void testContractTransferToOther() {\n\n    DocGenerator docGenerator = GeneratorFactory.getGenerator(DocGenerator.class, \"other\");\n    Assert.assertNull(docGenerator);\n  }\n}"
  },
  {
    "path": "docgen/src/test/resources/HelloEndPoint.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n---\nswagger: \"2.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"swagger definition for HelloEndPoint\"\n  x-java-interface: \"gen.swagger.HelloEndPointIntf\"\nbasePath: \"/hello\"\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\npaths:\n  /sayHello:\n    get:\n      operationId: \"sayHello\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n  /sayHi:\n    get:\n      operationId: \"sayHi\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n"
  },
  {
    "path": "integration-tests/coverage-aggregate/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>integration-tests</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>coverage-aggregate</artifactId>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>cli</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>codegen</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>common</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>core</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>docgen</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>toolkit-maven-plugin</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-core</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-core-spring</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-style</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-compatibility</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-compatibility-spring</artifactId>\n    </dependency>\n\n  </dependencies>\n\n  <profiles>\n    <profile>\n      <id>jacoco</id>\n      <build>\n        <plugins>\n          <plugin>\n            <groupId>org.jacoco</groupId>\n            <artifactId>jacoco-maven-plugin</artifactId>\n            <executions>\n              <execution>\n                <phase>post-integration-test</phase>\n                <goals>\n                  <goal>report-aggregate</goal>\n                </goals>\n              </execution>\n            </executions>\n          </plugin>\n        </plugins>\n      </build>\n    </profile>\n  </profiles>\n\n</project>\n"
  },
  {
    "path": "integration-tests/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>toolkit</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>integration-tests</artifactId>\n  <packaging>pom</packaging>\n  <modules>\n    <module>coverage-aggregate</module>\n  </modules>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-deploy-plugin</artifactId>\n        <configuration>\n          <skip>true</skip>\n        </configuration>\n      </plugin>\n    </plugins>\n  </build>\n</project>"
  },
  {
    "path": "oas-generator/oas-generator-core/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>oas-generator</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>oas-generator-core</artifactId>\n\n\n  <dependencies>\n    <dependency>\n      <groupId>io.swagger.core.v3</groupId>\n      <artifactId>swagger-models</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>io.swagger.core.v3</groupId>\n      <artifactId>swagger-annotations</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>io.swagger.core.v3</groupId>\n      <artifactId>swagger-core</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>junit</groupId>\n      <artifactId>junit</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.ow2.asm</groupId>\n      <artifactId>asm</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.powermock</groupId>\n      <artifactId>powermock-module-junit4</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.powermock</groupId>\n      <artifactId>powermock-api-mockito</artifactId>\n      <scope>test</scope>\n    </dependency>\n  </dependencies>\n\n\n</project>"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/HttpStatuses.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator;\n\npublic class HttpStatuses {\n\n  /**\n   *  HTTP/1.0 - RFC 1945\n   */\n  public final static String OK = \"200\";\n\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/MediaTypes.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator;\n\n/**\n * Common media type constants\n *\n * @see <a href=\"http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7\">HTTP/1.1 section 3.7</a>\n */\npublic class MediaTypes {\n\n  public final static String WILDCARD = \"*/*\";\n\n  public final static String APPLICATION_XML = \"application/xml\";\n\n  public final static String APPLICATION_ATOM_XML = \"application/atom+xml\";\n\n  public final static String APPLICATION_XHTML_XML = \"application/xhtml+xml\";\n\n  public final static String APPLICATION_SVG_XML = \"application/svg+xml\";\n\n  public final static String APPLICATION_JSON = \"application/json\";\n\n  public final static String APPLICATION_FORM_URLENCODED = \"application/x-www-form-urlencoded\";\n\n  public final static String MULTIPART_FORM_DATA = \"multipart/form-data\";\n\n  public final static String APPLICATION_OCTET_STREAM = \"application/octet-stream\";\n\n  public final static String TEXT_PLAIN = \"text/plain\";\n\n  public final static String TEXT_XML = \"text/xml\";\n\n  public final static String TEXT_HTML = \"text/html\";\n\n  public final static String SERVER_SENT_EVENTS = \"text/event-stream\";\n\n  public final static String APPLICATION_JSON_PATCH_JSON = \"application/json-patch+json\";\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/AnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\npublic interface AnnotationProcessor<Annotation, Context> {\n  void process(Annotation annotation, Context context);\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/ApiResponseMethodAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport java.util.Optional;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\n\nimport io.swagger.v3.oas.annotations.headers.Header;\nimport io.swagger.v3.oas.annotations.media.Content;\nimport io.swagger.v3.oas.annotations.responses.ApiResponse;\nimport io.swagger.v3.oas.models.media.MediaType;\n\npublic class ApiResponseMethodAnnotationProcessor implements\n    MethodAnnotationProcessor<ApiResponse, OperationContext> {\n  @Override\n  public void process(ApiResponse response, OperationContext context) {\n\n    io.swagger.v3.oas.models.responses.ApiResponse apiResponse = new io.swagger.v3.oas.models.responses.ApiResponse();\n\n    Content[] contentAnnotations = response.content();\n    Optional.ofNullable(contentAnnotations).ifPresent(contents -> {\n      for (Content contentAnnotation : contents) {\n        io.swagger.v3.oas.models.media.Content content = new io.swagger.v3.oas.models.media.Content();\n        MediaType mediaType = new MediaType();\n        content.addMediaType(contentAnnotation.mediaType(), mediaType);\n        apiResponse.setContent(content);\n      }\n    });\n\n    if (StringUtils.isNotEmpty(response.description())) {\n      apiResponse.setDescription(response.description());\n    } else {\n      apiResponse.description(\"OK\");\n    }\n\n    Header[] headersAnnotation = response.headers();\n    Optional.ofNullable(headersAnnotation).ifPresent(headers -> {\n      for (Header headerAnnotation : headers) {\n        io.swagger.v3.oas.models.headers.Header header = new io.swagger.v3.oas.models.headers.Header();\n        header.description(headerAnnotation.description());\n        header.deprecated(headerAnnotation.deprecated());\n        apiResponse.addHeaderObject(headerAnnotation.name(), header);\n      }\n    });\n\n    context.addResponse(response.responseCode(), apiResponse);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/ApiResponsesMethodAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport java.util.Arrays;\n\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\n\nimport io.swagger.v3.oas.annotations.responses.ApiResponse;\nimport io.swagger.v3.oas.annotations.responses.ApiResponses;\n\npublic class ApiResponsesMethodAnnotationProcessor implements\n    MethodAnnotationProcessor<ApiResponses, OperationContext> {\n  @Override\n  public void process(ApiResponses responses, OperationContext context) {\n\n    MethodAnnotationProcessor apiResponseAnnotationProcessor = context.getParser()\n        .findMethodAnnotationProcessor(ApiResponse.class);\n\n    if (apiResponseAnnotationProcessor != null) {\n      Arrays.stream(responses.value()).forEach(response -> apiResponseAnnotationProcessor.process(response, context));\n    }\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/ClassAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\npublic interface ClassAnnotationProcessor<Annotation, Context> extends AnnotationProcessor<Annotation, Context> {\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/MethodAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\npublic interface MethodAnnotationProcessor<Annotation, Context> extends AnnotationProcessor<Annotation, Context> {\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/ModelInterceptor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport java.lang.reflect.Type;\n\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.media.Schema;\n\npublic interface ModelInterceptor {\n\n  int order();\n\n  Schema process(Type cls, Components components);\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/OpenApiDefinitionClassAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\n\nimport io.swagger.v3.oas.annotations.OpenAPIDefinition;\nimport io.swagger.v3.oas.annotations.info.Info;\nimport io.swagger.v3.oas.models.info.Contact;\nimport io.swagger.v3.oas.models.info.License;\nimport io.swagger.v3.oas.models.servers.Server;\nimport io.swagger.v3.oas.models.tags.Tag;\n\npublic class OpenApiDefinitionClassAnnotationProcessor implements\n    ClassAnnotationProcessor<OpenAPIDefinition, OasContext> {\n\n  @Override\n  public void process(OpenAPIDefinition openAPIDefinition, OasContext context) {\n\n    Info infoAnnotation = openAPIDefinition.info();\n    io.swagger.v3.oas.models.info.Info info = new io.swagger.v3.oas.models.info.Info();\n    License license = new License();\n    Contact contact = new Contact();\n\n    license.url(infoAnnotation.license().url());\n    license.name(infoAnnotation.license().name());\n    contact.name(infoAnnotation.contact().name());\n    contact.url(infoAnnotation.contact().url());\n    contact.email(infoAnnotation.contact().email());\n\n    info\n        .description(infoAnnotation.description())\n        .title(infoAnnotation.title())\n        .version(infoAnnotation.version())\n        .license(license)\n        .contact(contact);\n    context.getOpenAPI().info(info);\n\n    if (openAPIDefinition.servers() != null) {\n      List<Server> serverList = new ArrayList<>();\n      for (io.swagger.v3.oas.annotations.servers.Server serverAnnotation : openAPIDefinition.servers()) {\n        Server server = new Server();\n        server.url(serverAnnotation.url());\n        server.description(serverAnnotation.description());\n        serverList.add(server);\n      }\n      context.getOpenAPI().servers(serverList);\n    }\n\n    if (openAPIDefinition.tags() != null) {\n      List<Tag> tagList = new ArrayList<>();\n      for (io.swagger.v3.oas.annotations.tags.Tag tagAnnotation : openAPIDefinition.tags()) {\n        Tag tag = new Tag();\n        tag\n            .name(tagAnnotation.name())\n            .description(tagAnnotation.description());\n        tagList.add(tag);\n      }\n\n      context.getOpenAPI().tags(tagList);\n    }\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/OperationMethodAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport java.util.Arrays;\nimport java.util.Map;\nimport java.util.Optional;\n\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.apache.servicecomb.toolkit.generator.util.SwaggerAnnotationUtils;\n\nimport io.swagger.v3.oas.annotations.Operation;\nimport io.swagger.v3.oas.annotations.responses.ApiResponse;\n\npublic class OperationMethodAnnotationProcessor implements MethodAnnotationProcessor<Operation, OperationContext> {\n\n  @Override\n  public void process(Operation annotation, OperationContext context) {\n\n    context.setOperationId(annotation.operationId());\n    context.setDeprecated(annotation.deprecated());\n    context.setDescription(annotation.description());\n\n    Map<String, Object> extensionsFromAnnotation = SwaggerAnnotationUtils\n        .getExtensionsFromAnnotation(annotation.extensions());\n    Optional.ofNullable(extensionsFromAnnotation)\n        .ifPresent(extensions -> extensions.forEach(context::addExtension));\n\n    ApiResponse[] responses = annotation.responses();\n    MethodAnnotationProcessor apiResponseAnnotationProcessor = context.getParser()\n        .findMethodAnnotationProcessor(ApiResponse.class);\n\n    for (ApiResponse response : responses) {\n      Optional.ofNullable(apiResponseAnnotationProcessor)\n          .ifPresent(processor -> processor.process(response, context));\n    }\n\n    context.setHttpMethod(annotation.method());\n    context.setSummary(annotation.summary());\n    Arrays.stream(annotation.tags()).forEach(context::addTag);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/ParamAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\npublic interface ParamAnnotationProcessor<Annotation, ParameterContext> extends AnnotationProcessor<Annotation, ParameterContext> {\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/ParameterAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport java.util.Collections;\n\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\nimport org.apache.servicecomb.toolkit.generator.util.SwaggerAnnotationUtils;\n\nimport io.swagger.v3.oas.annotations.Parameter;\nimport io.swagger.v3.oas.annotations.enums.Explode;\nimport io.swagger.v3.oas.annotations.media.Schema;\n\npublic class ParameterAnnotationProcessor implements ParamAnnotationProcessor<Parameter, ParameterContext> {\n\n  @Override\n  public void process(Parameter parameterAnnotation, ParameterContext paramCtx) {\n\n    Schema schema = parameterAnnotation.schema();\n\n    io.swagger.v3.oas.models.media.Schema schemaFromAnnotation = SwaggerAnnotationUtils.getSchemaFromAnnotation(schema);\n    if (schemaFromAnnotation != null) {\n      paramCtx.setSchema(schemaFromAnnotation);\n    }\n\n    paramCtx.setRequired(parameterAnnotation.required());\n    paramCtx.setAllowEmptyValue(parameterAnnotation.allowEmptyValue());\n    paramCtx.setAllowReserved(parameterAnnotation.allowReserved());\n    paramCtx.setDeprecated(parameterAnnotation.deprecated());\n    paramCtx.setExample(parameterAnnotation.example());\n\n    switch (parameterAnnotation.in()) {\n      case HEADER:\n        paramCtx.setIn(InType.HEADER);\n        break;\n      case COOKIE:\n        paramCtx.setIn(InType.COOKIE);\n        break;\n      case PATH:\n        paramCtx.setIn(InType.PATH);\n        break;\n      case QUERY:\n      case DEFAULT:\n      default:\n        paramCtx.setIn(InType.QUERY);\n    }\n\n    paramCtx.setDescription(parameterAnnotation.description());\n    paramCtx.setRef(parameterAnnotation.ref());\n    paramCtx.setName(parameterAnnotation.name());\n    paramCtx.setExplode(getExplode(parameterAnnotation.explode()));\n    paramCtx.applyAnnotations(Collections.singletonList(parameterAnnotation));\n  }\n\n  private Boolean getExplode(Explode explode) {\n\n    switch (explode) {\n      case TRUE: {\n        return true;\n      }\n      case FALSE:\n      case DEFAULT:\n      default: {\n        return false;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/RequestBodyParamAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport java.util.List;\nimport java.util.Optional;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\nimport org.apache.servicecomb.toolkit.generator.util.SwaggerAnnotationUtils;\n\nimport io.swagger.v3.oas.annotations.media.Content;\nimport io.swagger.v3.oas.annotations.parameters.RequestBody;\n\npublic class RequestBodyParamAnnotationProcessor implements ParamAnnotationProcessor<RequestBody, ParameterContext> {\n\n  @Override\n  public void process(RequestBody requestBodyAnnotation, ParameterContext context) {\n\n    context.setIn(InType.BODY);\n    io.swagger.v3.oas.models.parameters.RequestBody requestBody = new io.swagger.v3.oas.models.parameters.RequestBody();\n\n    requestBody.setRequired(requestBodyAnnotation.required());\n    requestBody.setDescription(requestBodyAnnotation.description());\n\n    if (StringUtils.isNotEmpty(requestBodyAnnotation.ref())) {\n      requestBody.set$ref(requestBodyAnnotation.ref());\n    }\n\n    Content[] contentAnnotations = requestBodyAnnotation.content();\n\n    List<io.swagger.v3.oas.models.media.Content> contentsFromAnnotation = SwaggerAnnotationUtils\n        .getContentFromAnnotation(contentAnnotations);\n\n    Optional.ofNullable(contentsFromAnnotation).ifPresent(contents -> {\n      requestBody.content(contents.get(0));\n    });\n\n    context.setRequestBody(requestBody);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/context/Context.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.context;\n\nimport org.apache.servicecomb.toolkit.generator.parser.api.OpenApiAnnotationParser;\n\npublic interface Context {\n  OpenApiAnnotationParser getParser();\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/context/IExtensionsContext.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.context;\n\nimport java.util.Map;\n\npublic interface IExtensionsContext extends Context {\n\n  void addExtension(String name, Object value);\n\n  Map<String, Object> getExtensions();\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/context/ISchemaContext.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.context;\n\nimport io.swagger.v3.oas.models.media.Schema;\n\npublic interface ISchemaContext extends Context, IExtensionsContext {\n\n  Schema getSchema();\n\n  void setSchema(Schema schema);\n}"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/context/OasContext.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.context;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.generator.parser.api.OpenApiAnnotationParser;\n\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.PathItem;\nimport io.swagger.v3.oas.models.PathItem.HttpMethod;\nimport io.swagger.v3.oas.models.Paths;\nimport io.swagger.v3.oas.models.info.Info;\nimport io.swagger.v3.oas.models.servers.Server;\n\npublic class OasContext implements IExtensionsContext {\n\n  private OpenAPI openAPI;\n\n  private String basePath;\n\n  private Class<?> cls;\n\n  private List<OperationContext> operationList = new ArrayList<>();\n\n  private OpenApiAnnotationParser parser;\n\n  private List<ISchemaContext> schemaCtxList = new ArrayList<>();\n\n  private String httpMethod;\n\n  private String[] consumes;\n\n  private String[] produces;\n\n  private String[] headers;\n\n  public OasContext(OpenApiAnnotationParser parser) {\n    this(new OpenAPI(), parser);\n  }\n\n  public OasContext(OpenAPI openAPI, OpenApiAnnotationParser parser) {\n    this.openAPI = openAPI;\n    this.parser = parser;\n  }\n\n  public OpenAPI toOpenAPI() {\n    ensurePaths();\n    for (OperationContext operationCtx : operationList) {\n      if (!operationCtx.hasOperation()) {\n        continue;\n      }\n\n      if (openAPI.getPaths() == null) {\n        openAPI.setPaths(new Paths());\n      }\n\n      PathItem pathItem = openAPI.getPaths().get(operationCtx.getPath());\n      if (pathItem == null) {\n        pathItem = new PathItem();\n        openAPI.path(operationCtx.getPath(), pathItem);\n      }\n      pathItem.operation(HttpMethod.valueOf(operationCtx.getHttpMethod()), operationCtx.toOperation());\n    }\n\n    // return null if there is no restful resource\n    if (openAPI.getPaths() == null || openAPI.getPaths().size() == 0) {\n      return null;\n    }\n\n    openAPI.info(new Info().title(\"gen\").version(\"1.0.0\"));\n\n    correctBasepath();\n    correctComponents();\n\n    openAPI.servers(Collections.singletonList(new Server().url(basePath)));\n    schemaCtxList.forEach(schemaCtx -> openAPI.schema(schemaCtx.getSchema().getName(), schemaCtx.getSchema()));\n    return openAPI;\n  }\n\n  private void correctComponents() {\n    Components nullComponents = new Components();\n    if (nullComponents.equals(getComponents())) {\n      openAPI.setComponents(null);\n    }\n  }\n\n  private void correctBasepath() {\n    if (StringUtils.isEmpty(basePath)) {\n      basePath = \"/\";\n    }\n\n    if (!basePath.startsWith(\"/\")) {\n      basePath = \"/\" + basePath;\n    }\n  }\n\n  public Components getComponents() {\n    if (openAPI.getComponents() == null) {\n      openAPI.setComponents(new Components());\n    }\n    return openAPI.getComponents();\n  }\n\n  private void ensurePaths() {\n    if (openAPI.getPaths() == null) {\n      openAPI.setPaths(new Paths());\n    }\n  }\n\n  @Override\n  public OpenApiAnnotationParser getParser() {\n    return parser;\n  }\n\n  public void setParser(OpenApiAnnotationParser parser) {\n    this.parser = parser;\n  }\n\n  public OpenAPI getOpenAPI() {\n    return openAPI;\n  }\n\n  public String getBasePath() {\n    return basePath;\n  }\n\n  public Class<?> getCls() {\n    return cls;\n  }\n\n  public void setCls(Class<?> cls) {\n    this.cls = cls;\n  }\n\n  public void setBasePath(String basePath) {\n    this.basePath = basePath;\n  }\n\n  public void addOperation(OperationContext operation) {\n    operationList.add(operation);\n  }\n\n  @Override\n  public void addExtension(String name, Object value) {\n    openAPI.addExtension(name, value);\n  }\n\n  @Override\n  public Map<String, Object> getExtensions() {\n    return openAPI.getExtensions();\n  }\n\n  public String getHttpMethod() {\n    return httpMethod;\n  }\n\n  public void setHttpMethod(String httpMethod) {\n    this.httpMethod = httpMethod;\n  }\n\n  public String[] getConsumers() {\n    return consumes;\n  }\n\n  public void setConsumers(String[] consumes) {\n    this.consumes = consumes;\n  }\n\n  public String[] getProduces() {\n    return produces;\n  }\n\n  public void setProduces(String[] produces) {\n    this.produces = produces;\n  }\n\n  public String[] getHeaders() {\n    return headers;\n  }\n\n  public void setHeaders(String[] headers) {\n    this.headers = headers;\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/context/OasGenerator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.context;\n\nimport java.util.ArrayList;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.ServiceLoader;\nimport java.util.Set;\n\nimport org.apache.servicecomb.toolkit.generator.parser.api.OpenApiAnnotationParser;\n\nimport io.swagger.v3.oas.models.OpenAPI;\n\npublic class OasGenerator {\n\n  private static List<OpenApiAnnotationParser> parserList = new ArrayList<>();\n\n  static {\n    ServiceLoader.load(OpenApiAnnotationParser.class).forEach(parserList::add);\n    parserList.sort(Comparator.comparingInt(OpenApiAnnotationParser::getOrder));\n  }\n\n  public OpenAPI generate(Class<?> cls) {\n\n    Optional<OpenApiAnnotationParser> parserOptional = parserList.stream().filter(parser -> parser.canProcess(cls))\n        .findFirst();\n\n    if (!parserOptional.isPresent()) {\n      return null;\n    }\n    OasContext context = new OasContext(parserOptional.get());\n    parserOptional.get().parser(cls, context);\n    return context.toOpenAPI();\n  }\n\n  public List<OpenAPI> generate(Set<Class> classes) {\n\n    List<OpenAPI> openApiList = new ArrayList<>();\n    for (Class cls : classes) {\n      OpenAPI openAPI = generate(cls);\n      if (openAPI != null) {\n        openApiList.add(openAPI);\n      }\n    }\n\n    return openApiList;\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/context/OperationContext.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.context;\n\nimport java.lang.reflect.Method;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.stream.Collectors;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.generator.HttpStatuses;\nimport org.apache.servicecomb.toolkit.generator.MediaTypes;\nimport org.apache.servicecomb.toolkit.generator.parser.api.OpenApiAnnotationParser;\nimport org.apache.servicecomb.toolkit.generator.util.ModelConverter;\nimport org.apache.servicecomb.toolkit.generator.util.RequestResponse;\n\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.Operation;\nimport io.swagger.v3.oas.models.media.Content;\nimport io.swagger.v3.oas.models.media.MediaType;\nimport io.swagger.v3.oas.models.media.ObjectSchema;\nimport io.swagger.v3.oas.models.media.Schema;\nimport io.swagger.v3.oas.models.media.StringSchema;\nimport io.swagger.v3.oas.models.parameters.HeaderParameter;\nimport io.swagger.v3.oas.models.parameters.Parameter;\nimport io.swagger.v3.oas.models.parameters.RequestBody;\nimport io.swagger.v3.oas.models.responses.ApiResponse;\nimport io.swagger.v3.oas.models.responses.ApiResponses;\n\npublic class OperationContext implements IExtensionsContext {\n\n  private static final RequestBody nullRequestBody = new RequestBody();\n\n  private OasContext parentContext;\n\n  private Method method;\n\n  private Operation operation = new Operation();\n\n  private String operationId;\n\n  private String path;\n\n  private String httpMethod;\n\n  private ApiResponses apiResponses = new ApiResponses();\n\n  private List<ParameterContext> parameterContexts = new ArrayList<>();\n\n  private OpenApiAnnotationParser parser;\n\n  private Boolean deprecated = false;\n\n  private String description = null;\n\n  private String summary;\n\n  private List<String> tags;\n\n  private String[] consumes;\n\n  private String[] produces;\n\n  private String[] headers;\n\n  public OperationContext(Method method, OasContext parentContext) {\n    this.parentContext = parentContext;\n    this.method = method;\n    this.parser = parentContext.getParser();\n    this.parentContext.addOperation(this);\n  }\n\n  @Override\n  public OpenApiAnnotationParser getParser() {\n    return parser;\n  }\n\n  public boolean hasOperation() {\n    return getHttpMethod() != null && method != null;\n  }\n\n  public Operation toOperation() {\n\n    if (!hasOperation()) {\n      return null;\n    }\n\n    if (StringUtils.isEmpty(operationId)) {\n      operationId = method.getName();\n    }\n\n    operation.operationId(operationId);\n    processHeaders();\n    processProduces();\n    correctResponse(apiResponses);\n    operation.setResponses(apiResponses);\n\n    RequestBody requestBody = new RequestBody();\n    Content content = new Content();\n    MediaType mediaType = new MediaType();\n\n    // process parameter\n    List<Parameter> parameterList = parameterContexts.stream()\n        .map(parameterContext ->\n        {\n          // requestBody\n          if (parameterContext.isRequestBody()) {\n\n            Schema schema = mediaType.getSchema();\n            if (schema == null) {\n              schema = new ObjectSchema();\n              mediaType.schema(schema);\n            }\n            schema.addProperties(parameterContext.getName(), parameterContext.getSchema());\n            if (consumes != null) {\n              for (String consume : getConsumers()) {\n                content.addMediaType(consume, mediaType);\n              }\n            } else {\n              if (parameterContext.getConsumers() != null && parameterContext.getConsumers().size() > 0) {\n                for (String consume : parameterContext.getConsumers()) {\n                  content.addMediaType(consume, mediaType);\n                }\n              } else {\n                content.addMediaType(MediaTypes.APPLICATION_JSON, mediaType);\n              }\n            }\n\n            requestBody.setContent(content);\n            requestBody.setRequired(parameterContext.getRequired());\n            return null;\n          }\n\n          // parameter\n          return parameterContext.toParameter();\n        })\n        .filter(parameter -> parameter != null)\n        .collect(Collectors.toList());\n\n    if (parameterList.size() > 0) {\n      operation.parameters(parameterList);\n    }\n\n    if (!nullRequestBody.equals(requestBody)) {\n      operation.setRequestBody(requestBody);\n    }\n    return operation;\n  }\n\n  private void processHeaders() {\n\n    if (getHeaders() == null) {\n      return;\n    }\n\n    Arrays.stream(headers).forEach(header -> {\n      String[] headMap = header.split(\"=\");\n      if (headMap.length == 2) {\n        HeaderParameter headerParameter = new HeaderParameter();\n        headerParameter.setName(headMap[0]);\n        StringSchema value = new StringSchema();\n        value.setDefault(headMap[1]);\n        headerParameter.setSchema(value);\n        operation.addParametersItem(headerParameter);\n      }\n    });\n  }\n\n  private void processProduces() {\n\n    if (getProduces() == null) {\n      return;\n    }\n\n    List<String> produceList = Arrays.stream(produces).filter(s -> !StringUtils.isEmpty(s))\n        .collect(Collectors.toList());\n\n    if (!produceList.isEmpty()) {\n      ApiResponse apiResponse = new ApiResponse();\n      Content content = new Content();\n      MediaType mediaType = new MediaType();\n      Schema schema = ModelConverter\n          .getSchema(getMethod().getReturnType(), getComponents(), RequestResponse.RESPONSE);\n      mediaType.schema(schema);\n      for (String produce : produceList) {\n        content.addMediaType(produce, mediaType);\n      }\n      apiResponse.description(\"OK\");\n      apiResponse.setContent(content);\n      addResponse(HttpStatuses.OK, apiResponse);\n    }\n  }\n\n  public void setRequestBody(RequestBody requestBody) {\n    operation.requestBody(requestBody);\n  }\n\n  public void correctResponse(ApiResponses apiResponses) {\n\n    if (apiResponses == null) {\n      return;\n    }\n\n    // no annotations are processed\n    // generate a default response based on the method return value\n    if (apiResponses.get(HttpStatuses.OK) == null) {\n      ApiResponse apiResponse = new ApiResponse();\n\n      Class<?> returnType = method.getReturnType();\n      if (returnType == Void.TYPE || returnType == Void.class) {\n        return;\n      }\n\n      MediaType mediaType = new MediaType();\n\n      Schema refSchema = ModelConverter.getSchema(returnType, getComponents(), RequestResponse.RESPONSE);\n      mediaType.schema(refSchema);\n\n      Content content = new Content();\n      content.addMediaType(MediaTypes.APPLICATION_JSON, mediaType);\n      apiResponse.description(\"OK\");\n      apiResponse.setContent(content);\n      apiResponses.addApiResponse(HttpStatuses.OK, apiResponse);\n    }\n  }\n\n  public Components getComponents() {\n    return parentContext.getComponents();\n  }\n\n  public void addResponse(String key, ApiResponse response) {\n    apiResponses.addApiResponse(key, response);\n  }\n\n  public ApiResponses getApiResponses() {\n    return apiResponses;\n  }\n\n  public void setApiResponses(ApiResponses apiResponses) {\n    this.apiResponses = apiResponses;\n  }\n\n  public String getOperationId() {\n    return operationId;\n  }\n\n  public void setOperationId(String operationId) {\n    this.operationId = operationId;\n  }\n\n  public String getPath() {\n    return path;\n  }\n\n  public void setPath(String path) {\n    this.path = path;\n  }\n\n  public Operation getOperation() {\n    return operation;\n  }\n\n  public OpenAPI getOpenAPI() {\n    return parentContext.getOpenAPI();\n  }\n\n  public Method getMethod() {\n    return method;\n  }\n\n  public OasContext getOpenApiContext() {\n    return parentContext;\n  }\n\n  public String getHttpMethod() {\n    return Optional.ofNullable(httpMethod).orElse(parentContext.getHttpMethod());\n  }\n\n  public void setHttpMethod(String httpMethod) {\n    if (this.httpMethod != null) {\n      throw new IllegalArgumentException(String.format(\"too many http method in the method %s\", method.getName()));\n    }\n    this.httpMethod = httpMethod.toUpperCase();\n  }\n\n  public Boolean getDeprecated() {\n    return deprecated;\n  }\n\n  public void setDeprecated(Boolean deprecated) {\n    this.deprecated = deprecated;\n  }\n\n  public String getDescription() {\n    return description;\n  }\n\n  public void setDescription(String description) {\n    this.description = description;\n  }\n\n  public String getSummary() {\n    return summary;\n  }\n\n  public void setSummary(String summary) {\n    this.summary = summary;\n  }\n\n  public List<String> getTags() {\n    return tags;\n  }\n\n  public void setTags(List<String> tags) {\n    this.tags = tags;\n  }\n\n  public void addTag(String tag) {\n    if (tags == null) {\n      tags = new ArrayList<>();\n    }\n    tags.add(tag);\n  }\n\n  @Override\n  public void addExtension(String name, Object value) {\n    operation.addExtension(name, value);\n  }\n\n  @Override\n  public Map<String, Object> getExtensions() {\n    return operation.getExtensions();\n  }\n\n  public String[] getConsumers() {\n    return consumes;\n  }\n\n  public void setConsumers(String[] consumes) {\n    this.consumes = consumes;\n  }\n\n  public void addParamCtx(ParameterContext ctx) {\n    this.parameterContexts.add(ctx);\n  }\n\n  public String[] getProduces() {\n\n    if (produces == null) {\n      produces = parentContext.getProduces();\n    }\n\n    return produces;\n  }\n\n  public void setProduces(String[] produces) {\n    this.produces = produces;\n  }\n\n  public String[] getHeaders() {\n\n    if (headers == null) {\n      headers = parentContext.getHeaders();\n    }\n\n    return headers;\n  }\n\n  public void setHeaders(String[] headers) {\n    this.headers = headers;\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/context/ParameterContext.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.context;\n\nimport java.lang.annotation.Annotation;\nimport java.lang.reflect.Parameter;\nimport java.lang.reflect.Type;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.generator.parser.api.OpenApiAnnotationParser;\nimport org.apache.servicecomb.toolkit.generator.util.ModelConverter;\nimport org.apache.servicecomb.toolkit.generator.util.ParamUtils;\nimport org.apache.servicecomb.toolkit.generator.util.RequestResponse;\n\nimport io.swagger.v3.core.util.ParameterProcessor;\nimport io.swagger.v3.core.util.ReflectionUtils;\nimport io.swagger.v3.oas.annotations.enums.ParameterIn;\nimport io.swagger.v3.oas.annotations.enums.ParameterStyle;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.examples.Example;\nimport io.swagger.v3.oas.models.media.Content;\nimport io.swagger.v3.oas.models.media.Schema;\nimport io.swagger.v3.oas.models.parameters.RequestBody;\n\npublic class ParameterContext implements ISchemaContext, IExtensionsContext {\n\n  private final static Schema nullSchema = new Schema();\n\n  private OperationContext parentContext;\n\n  private Parameter parameter;\n\n  private Object defaultValue;\n\n  private io.swagger.v3.oas.models.parameters.Parameter oasParameter = new io.swagger.v3.oas.models.parameters.Parameter();\n\n  private String name = null;\n\n  private InType in = null;\n\n  private String description = null;\n\n  private Boolean required = null;\n\n  private Boolean deprecated = null;\n\n  private Boolean allowEmptyValue = null;\n\n  private ParameterStyle style;\n\n  private Boolean explode = null;\n\n  private Boolean allowReserved = null;\n\n  private Schema schema;\n\n  private Object example = null;\n\n  private Map<String, Example> examples = null;\n\n  private Content content = null;\n\n  private String ref = null;\n\n  private RequestBody requestBody;\n\n  private List<String> consumes;\n\n  public ParameterContext(OperationContext parentContext, Parameter parameter) {\n    this.parentContext = parentContext;\n    this.parameter = parameter;\n    parentContext.addParamCtx(this);\n  }\n\n  public io.swagger.v3.oas.models.parameters.Parameter toParameter() {\n\n    if (parameter == null) {\n      return null;\n    }\n    ensureName();\n    if (schema == null || nullSchema.equals(schema)) {\n      schema = ModelConverter.getSchema(parameter.getType(), getComponents(), RequestResponse.REQUEST);\n      oasParameter.schema(schema);\n    }\n\n    if (in == null) {\n      oasParameter.setIn(ParameterIn.QUERY.toString());\n    } else {\n      switch (in) {\n        case PATH: {\n          oasParameter.setIn(ParameterIn.PATH.toString());\n          break;\n        }\n        case QUERY: {\n          oasParameter.setIn(ParameterIn.QUERY.toString());\n          break;\n        }\n        case COOKIE: {\n          oasParameter.setIn(ParameterIn.COOKIE.toString());\n          break;\n        }\n        case HEADER: {\n          oasParameter.setIn(ParameterIn.HEADER.toString());\n          break;\n        }\n        default:\n          oasParameter.setIn(ParameterIn.QUERY.toString());\n      }\n    }\n\n    if (defaultValue != null) {\n      required = false;\n      oasParameter.getSchema().setDefault(defaultValue);\n    }\n\n    oasParameter.setRequired(required);\n    return oasParameter;\n  }\n\n  public boolean isRequestBody() {\n    if (in != null && (in.equals(InType.BODY) || in.equals(InType.FORM))) {\n      return true;\n    }\n    return false;\n  }\n\n  public void applyAnnotations(List<Annotation> annotations) {\n    ParameterProcessor\n        .applyAnnotations(oasParameter, getType(), annotations,\n            getComponents(),\n            null, null, null);\n  }\n\n  private void ensureName() {\n    if (StringUtils.isEmpty(name)) {\n      // try get real type\n      name = ParamUtils.getParameterName(parentContext.getMethod(), parameter);\n    }\n\n    if (StringUtils.isEmpty(name)) {\n      name = parameter.getName();\n    }\n\n    oasParameter.setName(name);\n  }\n\n  public OperationContext getOperationContext() {\n    return parentContext;\n  }\n\n  public Object getDefaultValue() {\n    return defaultValue;\n  }\n\n  public void setDefaultValue(Object defaultValue) {\n    this.defaultValue = defaultValue;\n  }\n\n  public Components getComponents() {\n    return parentContext.getComponents();\n  }\n\n  public io.swagger.v3.oas.models.parameters.Parameter getOasParameter() {\n    return oasParameter;\n  }\n\n  public Parameter getParameter() {\n    return parameter;\n  }\n\n  public void setParameter(Parameter parameter) {\n    this.parameter = parameter;\n  }\n\n  public boolean isRequired() {\n    return required;\n  }\n\n  public Type getType() {\n\n    if (getRealType() != null) {\n      return getRealType();\n    }\n\n    if (StringUtils.isNotEmpty(oasParameter.getIn())) {\n      return ReflectionUtils.typeFromString(oasParameter.getIn());\n    }\n\n    return null;\n  }\n\n  public void addConsume(String consume) {\n    if (consumes == null) {\n      consumes = new ArrayList<>();\n    }\n    consumes.add(consume);\n  }\n\n  public List<String> getConsumers() {\n    return consumes;\n  }\n\n  public Type getRealType() {\n    return parameter.getParameterizedType();\n  }\n\n  public void setRequestBody(RequestBody requestBody) {\n    required = requestBody.getRequired();\n    description = requestBody.getDescription();\n    this.requestBody = requestBody;\n  }\n\n  public RequestBody getRequestBody() {\n    return requestBody;\n  }\n\n  @Override\n  public Schema getSchema() {\n\n    Schema refSchema = oasParameter.getSchema();\n    if (refSchema == null || nullSchema.equals(refSchema)) {\n      refSchema = ModelConverter.getSchema(parameter.getType(), getComponents(), RequestResponse.REQUEST);\n      oasParameter.schema(refSchema);\n    }\n\n    return refSchema;\n  }\n\n  @Override\n  public void setSchema(Schema schema) {\n    this.schema = schema;\n  }\n\n  @Override\n  public void addExtension(String name, Object value) {\n    oasParameter.addExtension(name, value);\n  }\n\n  @Override\n  public Map<String, Object> getExtensions() {\n    return oasParameter.getExtensions();\n  }\n\n  @Override\n  public OpenApiAnnotationParser getParser() {\n    return parentContext.getParser();\n  }\n\n  public String getName() {\n    ensureName();\n    return name;\n  }\n\n  public void setName(String name) {\n    this.name = name;\n  }\n\n  public InType getIn() {\n    return in;\n  }\n\n  public void setIn(InType in) {\n    this.in = in;\n  }\n\n  public String getDescription() {\n    return description;\n  }\n\n  public void setDescription(String description) {\n    this.description = description;\n  }\n\n  public Boolean getRequired() {\n    return required;\n  }\n\n  public void setRequired(Boolean required) {\n    this.required = required;\n  }\n\n  public Boolean getDeprecated() {\n    return deprecated;\n  }\n\n  public void setDeprecated(Boolean deprecated) {\n    this.deprecated = deprecated;\n  }\n\n  public Boolean getAllowEmptyValue() {\n    return allowEmptyValue;\n  }\n\n  public void setAllowEmptyValue(Boolean allowEmptyValue) {\n    this.allowEmptyValue = allowEmptyValue;\n  }\n\n  public ParameterStyle getStyle() {\n    return style;\n  }\n\n  public void setStyle(ParameterStyle style) {\n    this.style = style;\n  }\n\n  public Boolean getExplode() {\n    return explode;\n  }\n\n  public void setExplode(Boolean explode) {\n    this.explode = explode;\n  }\n\n  public Boolean getAllowReserved() {\n    return allowReserved;\n  }\n\n  public void setAllowReserved(Boolean allowReserved) {\n    this.allowReserved = allowReserved;\n  }\n\n  public Object getExample() {\n    return example;\n  }\n\n  public void setExample(Object example) {\n    this.example = example;\n  }\n\n  public Map<String, Example> getExamples() {\n    return examples;\n  }\n\n  public void setExamples(Map<String, Example> examples) {\n    this.examples = examples;\n  }\n\n  public Content getContent() {\n    return content;\n  }\n\n  public void setContent(Content content) {\n    this.content = content;\n  }\n\n  public String getRef() {\n    return ref;\n  }\n\n  public void setRef(String ref) {\n    this.ref = ref;\n  }\n\n  public enum InType {\n    QUERY,\n    PATH,\n    HEADER,\n    COOKIE,\n    FORM,\n    BODY\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/parser/AbstractAnnotationParser.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.parser;\n\nimport java.lang.annotation.Annotation;\nimport java.lang.reflect.Method;\nimport java.util.Arrays;\nimport java.util.Comparator;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\nimport org.apache.servicecomb.toolkit.generator.annotation.AnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.ApiResponseMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.ApiResponsesMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.ClassAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.MethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.OpenApiDefinitionClassAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.OperationMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.ParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.ParameterAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestBodyParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.parser.api.OpenApiAnnotationParser;\n\nimport io.swagger.v3.oas.annotations.OpenAPIDefinition;\nimport io.swagger.v3.oas.annotations.Operation;\nimport io.swagger.v3.oas.annotations.Parameter;\nimport io.swagger.v3.oas.annotations.parameters.RequestBody;\nimport io.swagger.v3.oas.annotations.responses.ApiResponse;\nimport io.swagger.v3.oas.annotations.responses.ApiResponses;\n\npublic abstract class AbstractAnnotationParser implements OpenApiAnnotationParser {\n\n  private Class<?> cls;\n\n  private OasContext context;\n\n  protected Map<Class<? extends Annotation>, ClassAnnotationProcessor> classAnnotationMap = new HashMap<>();\n\n  protected Map<Class<? extends Annotation>, MethodAnnotationProcessor> methodAnnotationMap = new HashMap<>();\n\n  protected Map<Class<? extends Annotation>, ParamAnnotationProcessor> parameterAnnotationMap = new HashMap<>();\n\n  public AbstractAnnotationParser() {\n    initMethodAnnotationProcessor();\n    initClassAnnotationProcessor();\n    initParameterAnnotationProcessor();\n  }\n\n  @Override\n  public void parser(Class<?> cls, OasContext context) {\n\n    this.cls = cls;\n    this.context = context;\n\n    if (!canProcess(cls)) {\n      return;\n    }\n\n    for (Annotation clsAnnotation : cls.getAnnotations()) {\n      AnnotationProcessor annotationProcessor = classAnnotationMap.get(clsAnnotation.annotationType());\n      if (annotationProcessor == null) {\n        continue;\n      }\n      annotationProcessor.process(clsAnnotation, context);\n    }\n    postParseClassAnnotaion(context);\n\n    List<Method> methods = Arrays.asList(cls.getDeclaredMethods());\n    methods.sort(Comparator.comparing(Method::getName));\n    for (Method m : methods) {\n      OperationContext operationContext = new OperationContext(m, context);\n      for (Annotation methodAnnotation : m.getAnnotations()) {\n        MethodAnnotationProcessor annotationProcessor = methodAnnotationMap.get(methodAnnotation.annotationType());\n        if (annotationProcessor != null) {\n          annotationProcessor.process(methodAnnotation, operationContext);\n        }\n      }\n\n      postParseMethodAnnotation(operationContext);\n\n      java.lang.reflect.Parameter[] parameters = m.getParameters();\n\n      for (java.lang.reflect.Parameter parameter : parameters) {\n        ParameterContext parameterContext = new ParameterContext(operationContext, parameter);\n        for (Annotation paramAnnotation : parameter.getAnnotations()) {\n          ParamAnnotationProcessor paramAnnotationProcessor = parameterAnnotationMap\n              .get(paramAnnotation.annotationType());\n          if (paramAnnotationProcessor != null) {\n            paramAnnotationProcessor.process(paramAnnotation, parameterContext);\n          }\n        }\n        postParseParameterAnnotation(parameterContext);\n      }\n    }\n  }\n\n  @Override\n  public void postParseClassAnnotaion(OasContext context) {\n  }\n\n  @Override\n  public void postParseMethodAnnotation(OperationContext context) {\n  }\n\n  @Override\n  public void postParseParameterAnnotation(ParameterContext context) {\n  }\n\n  public void initMethodAnnotationProcessor() {\n    methodAnnotationMap.put(Operation.class, new OperationMethodAnnotationProcessor());\n    methodAnnotationMap.put(ApiResponse.class, new ApiResponseMethodAnnotationProcessor());\n    methodAnnotationMap.put(ApiResponses.class, new ApiResponsesMethodAnnotationProcessor());\n  }\n\n  public void initClassAnnotationProcessor() {\n    classAnnotationMap.put(OpenAPIDefinition.class, new OpenApiDefinitionClassAnnotationProcessor());\n  }\n\n  public void initParameterAnnotationProcessor() {\n    parameterAnnotationMap.put(Parameter.class, new ParameterAnnotationProcessor());\n    parameterAnnotationMap.put(RequestBody.class, new RequestBodyParamAnnotationProcessor());\n  }\n\n  @Override\n  public ClassAnnotationProcessor findClassAnnotationProcessor(Class<? extends Annotation> annotationType) {\n    return classAnnotationMap.get(annotationType);\n  }\n\n  @Override\n  public MethodAnnotationProcessor findMethodAnnotationProcessor(Class<? extends Annotation> annotationType) {\n    return methodAnnotationMap.get(annotationType);\n  }\n\n  @Override\n  public ParamAnnotationProcessor findParameterAnnotationProcessor(Class<? extends Annotation> annotationType) {\n    return parameterAnnotationMap.get(annotationType);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/parser/api/OpenApiAnnotationParser.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.parser.api;\n\nimport java.lang.annotation.Annotation;\n\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.annotation.ClassAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.MethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.ParamAnnotationProcessor;\n\npublic interface OpenApiAnnotationParser {\n\n  /**\n   *\n   * @param cls\n   * @param context\n   */\n  void parser(Class<?> cls, OasContext context);\n\n  /**\n   * Used for sorting\n   * For the same parsing class, only the same programming model can be parsed at the same time.\n   * @return\n   */\n  int getOrder();\n\n  boolean canProcess(Class<?> cls);\n\n  void postParseClassAnnotaion(OasContext context);\n\n  void postParseMethodAnnotation(OperationContext context);\n\n  void postParseParameterAnnotation(ParameterContext context);\n\n  ClassAnnotationProcessor findClassAnnotationProcessor(Class<? extends Annotation> annotationType);\n\n  MethodAnnotationProcessor findMethodAnnotationProcessor(Class<? extends Annotation> annotationType);\n\n  ParamAnnotationProcessor findParameterAnnotationProcessor(Class<? extends Annotation> annotationType);\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/util/ArrayModelConverter.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.util;\n\nimport java.util.Iterator;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.fasterxml.jackson.databind.type.TypeFactory;\n\nimport io.swagger.v3.core.converter.AnnotatedType;\nimport io.swagger.v3.core.converter.ModelConverter;\nimport io.swagger.v3.core.converter.ModelConverterContext;\nimport io.swagger.v3.core.jackson.AbstractModelConverter;\nimport io.swagger.v3.oas.models.media.ArraySchema;\nimport io.swagger.v3.oas.models.media.Schema;\n\npublic class ArrayModelConverter extends AbstractModelConverter {\n\n  protected ArrayModelConverter(ObjectMapper mapper) {\n    super(mapper);\n  }\n\n  @Override\n  public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterator<ModelConverter> chain) {\n\n    String typeName = _typeName(TypeFactory.defaultInstance().constructType(type.getType()));\n\n    ArraySchema schema;\n    if (\"Array\".equals(typeName)) {\n      schema = new ArraySchema();\n      if (!(type.getType() instanceof Class)) {\n        return null;\n      }\n      Schema itemSchema = context.resolve(new AnnotatedType(((Class) type.getType()).getComponentType()));\n      schema.setItems(itemSchema);\n      return schema;\n    }\n    return super.resolve(type, context, chain);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/util/LocalVariableVisitor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.util;\n\nimport org.objectweb.asm.Label;\nimport org.objectweb.asm.MethodVisitor;\nimport org.objectweb.asm.Type;\n\npublic class LocalVariableVisitor extends MethodVisitor {\n\n  private String[] parameterNames;\n\n  private final int[] lvtSlotIndex;\n\n  private final Type[] args;\n\n  public LocalVariableVisitor(int api, String desc, boolean isStatic, String[] parameterNames) {\n    super(api);\n    this.parameterNames = parameterNames;\n    this.args = Type.getArgumentTypes(desc);\n    this.lvtSlotIndex = computeLvtSlotIndices(isStatic, this.args);\n  }\n\n  @Override\n  public void visitLocalVariable(String name, String descriptor, String signature, Label start, Label end,\n      int index) {\n\n    for (int i = 0; i < this.lvtSlotIndex.length; i++) {\n      if (this.lvtSlotIndex[i] == index) {\n        this.parameterNames[i] = name;\n      }\n    }\n    super.visitLocalVariable(name, descriptor, signature, start, end, index);\n  }\n\n  int[] computeLvtSlotIndices(boolean isStatic, Type[] paramTypes) {\n    int[] lvtIndex = new int[paramTypes.length];\n    int nextIndex = (isStatic ? 0 : 1);\n    for (int i = 0; i < paramTypes.length; i++) {\n      lvtIndex[i] = nextIndex;\n      if (isWideType(paramTypes[i])) {\n        nextIndex += 2;\n      } else {\n        nextIndex++;\n      }\n    }\n    return lvtIndex;\n  }\n\n  private boolean isWideType(Type aType) {\n    return (aType == Type.LONG_TYPE || aType == Type.DOUBLE_TYPE);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/util/ModelConverter.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.util;\n\nimport java.lang.reflect.Method;\nimport java.lang.reflect.Modifier;\nimport java.lang.reflect.ParameterizedType;\nimport java.lang.reflect.Type;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.ServiceLoader;\n\nimport org.apache.servicecomb.toolkit.generator.annotation.ModelInterceptor;\n\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.databind.DeserializationFeature;\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.fasterxml.jackson.databind.SerializationFeature;\n\nimport io.swagger.v3.core.converter.AnnotatedType;\nimport io.swagger.v3.core.converter.ModelConverterContextImpl;\nimport io.swagger.v3.core.jackson.ModelResolver;\nimport io.swagger.v3.core.util.PrimitiveType;\nimport io.swagger.v3.core.util.RefUtils;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.media.ArraySchema;\nimport io.swagger.v3.oas.models.media.ObjectSchema;\nimport io.swagger.v3.oas.models.media.Schema;\n\npublic class ModelConverter {\n\n  private static final ModelConverterContextImpl context;\n\n  private static final List<ModelInterceptor> interceptorMgr = new ArrayList<>();\n\n  static {\n\n    ServiceLoader.load(ModelInterceptor.class).forEach(ModelConverter::registerInterceptor);\n\n    ArrayModelConverter arrayModelConverter = new ArrayModelConverter(mapper());\n    ModelResolver modelResolver = new ModelResolver(mapper());\n\n    context = new ModelConverterContextImpl(Arrays.asList(arrayModelConverter, modelResolver));\n  }\n\n  public static void registerInterceptor(ModelInterceptor interceptor) {\n    interceptorMgr.add(interceptor);\n    interceptorMgr.sort(Comparator.comparingInt(ModelInterceptor::order));\n  }\n\n  public static void unRegisterInterceptor(ModelInterceptor interceptor) {\n    interceptorMgr.remove(interceptor);\n  }\n\n  public static Schema getSchema(Type cls) {\n    return getSchema(cls, null, null);\n  }\n\n  public static Schema getSchema(Type cls, Components components, RequestResponse requestResponse) {\n\n    for (ModelInterceptor interceptor : interceptorMgr) {\n      Schema schema = interceptor.process(cls, components);\n      if (schema != null) {\n        return schema;\n      }\n    }\n\n    if (cls instanceof Class && requestResponse != null) {\n\n      List<Type> beanProperties = null;\n      switch (requestResponse) {\n        case REQUEST:\n          beanProperties = getRequestBeanTypes((Class) cls);\n          break;\n        case RESPONSE:\n          beanProperties = getResponseBeanTypes((Class) cls);\n          break;\n        default:\n      }\n\n      Optional.ofNullable(beanProperties)\n          .ifPresent(properties -> properties.forEach(type ->\n              {\n                if (type instanceof ParameterizedType) {\n                  Type[] actualTypeArguments = ((ParameterizedType) type).getActualTypeArguments();\n                  Arrays.stream(actualTypeArguments).forEach(arg -> getSchema(arg, components, requestResponse));\n                }\n\n                if (type instanceof Class) {\n                  getSchema(type, components, requestResponse);\n                }\n              })\n          );\n    }\n\n    Schema schema = PrimitiveType.createProperty(cls);\n    if (schema == null) {\n      schema = context\n          .resolve(new AnnotatedType(cls));\n    }\n\n    if (schema == null) {\n      if (cls == List.class) {\n        schema = new ArraySchema();\n        ((ArraySchema) schema).setItems(new ObjectSchema());\n      }\n    }\n\n    if (components == null) {\n      return schema;\n    }\n\n    // correct reference\n    Schema refSchema = schema;\n\n    if (shouldExtractRef(schema)) {\n      ensureSchemaNameExist(schema);\n      schema.$ref(null);\n      components.addSchemas(schema.getName(), schema);\n      refSchema = new Schema();\n      refSchema.set$ref(RefUtils.constructRef(schema.getName()));\n    }\n\n    if (schema instanceof ArraySchema) {\n      ArraySchema arraySchema = (ArraySchema) schema;\n      Schema itemSchema = arraySchema.getItems();\n      if (shouldExtractRef(itemSchema)) {\n        ensureSchemaNameExist(itemSchema);\n        itemSchema.$ref(null);\n        components.addSchemas(itemSchema.getName(), itemSchema);\n\n        Schema itemRefSchema = new Schema();\n        itemRefSchema.set$ref(RefUtils.constructRef(itemSchema.getName()));\n        arraySchema.setItems(itemRefSchema);\n      }\n\n      refSchema = arraySchema;\n    }\n\n    return refSchema;\n  }\n\n  private static void ensureSchemaNameExist(Schema schema) {\n    if (schema.getName() != null) {\n      return;\n    }\n\n    if (schema.get$ref() != null) {\n      schema.setName((String) RefUtils.extractSimpleName(schema.get$ref()).getKey());\n      return;\n    }\n  }\n\n  public static boolean shouldExtractRef(Schema schema) {\n    if (schema.getName() != null || schema.get$ref() != null) {\n      return true;\n    }\n    return false;\n  }\n\n\n  public static ObjectMapper mapper() {\n    ObjectMapper mapper = new ObjectMapper();\n    mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);\n    mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);\n    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);\n\n    return mapper;\n  }\n\n  public static List<Type> getRequestBeanTypes(Class cls) {\n    if (cls.isPrimitive()) {\n      return null;\n    }\n    Method[] declaredMethods = cls.getDeclaredMethods();\n    List<Type> beanProperties = new ArrayList<>();\n\n    for (Method method : declaredMethods) {\n\n      /**\n       * Meet the following requirements, can be considered a request bean property\n       * 1. method modifiers is public and non-static\n       * 2. method name should be setAbc or setABC, setabc is not a setter method\n       * 3. return value of method is void\n       * 4. method has only one parameter\n       */\n      if (Modifier.isPublic(method.getModifiers()) && !Modifier.isStatic(method.getModifiers()) && method.getName()\n          .startsWith(\"set\") && method.getName().length() > 3 && Character.isUpperCase(method.getName().charAt(3))\n          && method.getReturnType()\n          .equals(Void.TYPE) && method.getParameterCount() == 1) {\n        beanProperties.add(method.getGenericParameterTypes()[0]);\n      }\n    }\n    return beanProperties;\n  }\n\n  public static List<Type> getResponseBeanTypes(Class cls) {\n    if (cls.isPrimitive()) {\n      return null;\n    }\n    Method[] declaredMethods = cls.getDeclaredMethods();\n    List<Type> beanPropertyTypes = new ArrayList<>();\n\n    for (Method method : declaredMethods) {\n      /**\n       * Meet the following requirements, can be considered a response bean property\n       * 1. method modifiers is public and non-static\n       * 2. method name should be getAbc or getABC, getabc is not a getter method\n       * 3. return value of method is not void\n       * 4. method has no parameters\n       */\n      if (Modifier.isPublic(method.getModifiers()) && !Modifier.isStatic(method.getModifiers()) && method.getName()\n          .startsWith(\"get\") && method.getName().length() > 3 && Character.isUpperCase(method.getName().charAt(3))\n          && !method.getReturnType()\n          .equals(Void.TYPE) && method.getParameterCount() == 0) {\n        beanPropertyTypes.add(method.getGenericReturnType());\n      }\n    }\n    return beanPropertyTypes;\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/util/ParamUtils.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.util;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.lang.reflect.Method;\nimport java.lang.reflect.Modifier;\nimport java.lang.reflect.Parameter;\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport org.objectweb.asm.ClassReader;\nimport org.objectweb.asm.ClassVisitor;\nimport org.objectweb.asm.ClassWriter;\nimport org.objectweb.asm.MethodVisitor;\nimport org.objectweb.asm.Opcodes;\nimport org.objectweb.asm.Type;\n\npublic class ParamUtils {\n\n  private static final String STATIC_CLASS_INIT = \"<clinit>\";\n\n  public static final Map<Method, String[]> parameterCache = new HashMap();\n\n  public static String getParameterName(Method method, Parameter parameter) {\n\n    String[] parameterNames = parameterCache.get(method);\n\n    if (parameterNames == null) {\n      parameterNames = initParameterNames(method);\n      if (parameterNames == null) {\n        return null;\n      }\n    }\n\n    int paramIndex = getParamIndex(method, parameter);\n    if (paramIndex >= 0) {\n      return parameterNames[paramIndex];\n    }\n\n    return null;\n  }\n\n  private static int getParamIndex(Method method, Parameter parameter) {\n    Parameter[] parameters = method.getParameters();\n    for (int i = 0; i < parameters.length; i++) {\n      if (parameters[i].equals(parameter)) {\n        return i;\n      }\n    }\n    return -1;\n  }\n\n  private static String[] initParameterNames(Method m) {\n\n    boolean isStatic = Modifier.isStatic(m.getModifiers());\n    String[] parameterNames = new String[m.getParameterCount()];\n\n    try {\n\n      String className = m.getDeclaringClass().getName();\n      String classRawName = className.replace('.', '/') + \".class\";\n\n      InputStream is = null;\n      ClassLoader classLoader = m.getDeclaringClass().getClassLoader();\n      if (classLoader != null) {\n        is = classLoader.getResourceAsStream(classRawName);\n      } else {\n        is = m.getDeclaringClass().getResourceAsStream(classRawName);\n      }\n\n      if (is == null) {\n        return null;\n      }\n      ClassReader clsReader = new ClassReader(is);\n      ClassWriter clsWriter = new ClassWriter(ClassWriter.COMPUTE_MAXS);\n\n      clsReader.accept(new ClassVisitor(Opcodes.ASM7, clsWriter) {\n        @Override\n        public MethodVisitor visitMethod(int access, String name, String descriptor, String signature,\n            String[] exceptions) {\n          MethodVisitor methodVisitor = super.visitMethod(access, name, descriptor, signature, exceptions);\n          if (!m.getName().equals(name) || !descriptor.equals(Type.getMethodDescriptor(m))) {\n            return methodVisitor;\n          }\n\n          if (!isSyntheticOrBridged(access) && !STATIC_CLASS_INIT.equals(name)) {\n            return new LocalVariableVisitor(this.api, descriptor, isStatic, parameterNames);\n          }\n\n          return methodVisitor;\n        }\n      }, 0);\n    } catch (IOException e) {\n      e.printStackTrace();\n    }\n\n    parameterCache.put(m, parameterNames);\n\n    return parameterNames;\n  }\n\n  private static boolean isSyntheticOrBridged(int access) {\n    return (((access & Opcodes.ACC_SYNTHETIC) | (access & Opcodes.ACC_BRIDGE)) > 0);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/util/RequestResponse.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.util;\n\npublic enum RequestResponse {\n\n  /**\n   * Mark a request\n   */\n  REQUEST,\n\n  /**\n   * Mark a response\n   */\n  RESPONSE\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/main/java/org/apache/servicecomb/toolkit/generator/util/SwaggerAnnotationUtils.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.util;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\n\nimport io.swagger.v3.oas.annotations.extensions.Extension;\nimport io.swagger.v3.oas.annotations.extensions.ExtensionProperty;\nimport io.swagger.v3.oas.annotations.media.Encoding;\nimport io.swagger.v3.oas.models.media.Content;\nimport io.swagger.v3.oas.models.media.MediaType;\nimport io.swagger.v3.oas.models.media.Schema;\n\npublic class SwaggerAnnotationUtils {\n\n  public static List<Content> getContentFromAnnotation(\n      io.swagger.v3.oas.annotations.media.Content... contentAnnotations) {\n\n    if (contentAnnotations == null || contentAnnotations.length < 1) {\n      return null;\n    }\n\n    List<Content> contents = new ArrayList<>();\n\n    for (io.swagger.v3.oas.annotations.media.Content contentAnnotation : contentAnnotations) {\n      io.swagger.v3.oas.models.media.Content content = new io.swagger.v3.oas.models.media.Content();\n      MediaType mediaType = new MediaType();\n      Encoding[] encodingAnnotations = contentAnnotation.encoding();\n      Optional.ofNullable(encodingAnnotations).ifPresent(encodings -> {\n        for (Encoding encodingAnnotation : encodings) {\n          io.swagger.v3.oas.models.media.Encoding encoding = new io.swagger.v3.oas.models.media.Encoding();\n          encoding.contentType(encodingAnnotation.contentType());\n          encoding.allowReserved(encodingAnnotation.allowReserved());\n          encoding.explode(encodingAnnotation.explode());\n          mediaType.addEncoding(encodingAnnotation.name(), encoding);\n        }\n      });\n      content.addMediaType(contentAnnotation.mediaType(), mediaType);\n      contents.add(content);\n    }\n    return contents;\n  }\n\n  public static Schema getSchemaFromAnnotation(io.swagger.v3.oas.annotations.media.Schema schema) {\n    if (schema == null) {\n      return null;\n    }\n    Schema schemaObj = new Schema();\n    schemaObj.setName(schema.name());\n    schemaObj.setDescription(schema.description());\n    schemaObj.setType(schema.type());\n    schemaObj.setTitle(schema.title());\n    schemaObj.setNullable(schema.nullable());\n    schemaObj.setDefault(schema.defaultValue());\n    schemaObj.setFormat(schema.format());\n    schemaObj.setDeprecated(schema.deprecated());\n    Map<String, Object> extensionsFromAnnotation = getExtensionsFromAnnotation(schema.extensions());\n    schemaObj.extensions(extensionsFromAnnotation);\n    return schemaObj;\n  }\n\n  public static Map<String, Object> getExtensionsFromAnnotation(Extension... extensions) {\n    if (extensions == null || extensions.length < 1) {\n      return null;\n    }\n\n    Map<String, Object> extensionMap = new HashMap<>();\n    for (Extension extension : extensions) {\n      ExtensionProperty[] properties = extension.properties();\n      Optional.ofNullable(properties).ifPresent(props -> {\n        for (ExtensionProperty prop : props) {\n          extensionMap.put(prop.name(), prop.value());\n        }\n      });\n    }\n\n    return extensionMap;\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/test/java/org/apache/servicecomb/toolkit/generator/AnnotationProcessorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator;\n\nimport java.lang.reflect.Method;\n\nimport org.apache.servicecomb.toolkit.generator.annotation.ApiResponseMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.ApiResponsesMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.OpenApiDefinitionClassAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.OperationMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.ParameterAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestBodyParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.parser.AbstractAnnotationParser;\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.mockito.Mockito;\n\nimport io.swagger.v3.oas.annotations.ExternalDocumentation;\nimport io.swagger.v3.oas.annotations.OpenAPIDefinition;\nimport io.swagger.v3.oas.annotations.Operation;\nimport io.swagger.v3.oas.annotations.Parameter;\nimport io.swagger.v3.oas.annotations.enums.Explode;\nimport io.swagger.v3.oas.annotations.enums.ParameterIn;\nimport io.swagger.v3.oas.annotations.enums.ParameterStyle;\nimport io.swagger.v3.oas.annotations.extensions.Extension;\nimport io.swagger.v3.oas.annotations.extensions.ExtensionProperty;\nimport io.swagger.v3.oas.annotations.headers.Header;\nimport io.swagger.v3.oas.annotations.info.Contact;\nimport io.swagger.v3.oas.annotations.info.Info;\nimport io.swagger.v3.oas.annotations.info.License;\nimport io.swagger.v3.oas.annotations.links.Link;\nimport io.swagger.v3.oas.annotations.media.Content;\nimport io.swagger.v3.oas.annotations.media.ExampleObject;\nimport io.swagger.v3.oas.annotations.media.Schema;\nimport io.swagger.v3.oas.annotations.parameters.RequestBody;\nimport io.swagger.v3.oas.annotations.responses.ApiResponse;\nimport io.swagger.v3.oas.annotations.responses.ApiResponses;\nimport io.swagger.v3.oas.annotations.security.SecurityRequirement;\nimport io.swagger.v3.oas.annotations.servers.Server;\nimport io.swagger.v3.oas.annotations.servers.ServerVariable;\nimport io.swagger.v3.oas.annotations.tags.Tag;\nimport io.swagger.v3.oas.models.media.StringSchema;\n\npublic class AnnotationProcessorTest {\n\n  @Test\n  public void processApiResponseAnnotation() {\n\n    OasContext oasContext = new OasContext(null);\n    OperationContext context = new OperationContext(null, oasContext);\n    ApiResponseMethodAnnotationProcessor apiResProcessor = new ApiResponseMethodAnnotationProcessor();\n    ApiResponse apiResponse = Mockito.mock(ApiResponse.class);\n    Content[] contents = new Content[1];\n    contents[0] = Mockito.mock(Content.class);\n    Mockito.when(contents[0].mediaType()).thenReturn(MediaTypes.APPLICATION_JSON);\n    Mockito.when(apiResponse.content()).thenReturn(contents);\n    Mockito.when(apiResponse.responseCode()).thenReturn(\"200\");\n    apiResProcessor.process(apiResponse, context);\n\n    Assert.assertNotNull(context.getApiResponses().get(\"200\"));\n    Assert.assertNull(context.getApiResponses().get(\"500\"));\n  }\n\n  @Test\n  public void processApiResponsesAnnotation() {\n\n    OasContext oasContext = new OasContext(new AbstractAnnotationParser() {\n      @Override\n      public int getOrder() {\n        return 0;\n      }\n\n      @Override\n      public boolean canProcess(Class<?> cls) {\n        return true;\n      }\n    });\n\n    OperationContext context = new OperationContext(null, oasContext);\n    ApiResponsesMethodAnnotationProcessor apiRessProcessor = new ApiResponsesMethodAnnotationProcessor();\n    ApiResponses apiResponses = Mockito.mock(ApiResponses.class);\n    Content[] contents = new Content[1];\n    contents[0] = Mockito.mock(Content.class);\n    Mockito.when(contents[0].mediaType()).thenReturn(MediaTypes.APPLICATION_JSON);\n    ApiResponse apiResponse = Mockito.mock(ApiResponse.class);\n    Mockito.when(apiResponse.content()).thenReturn(contents);\n    Mockito.when(apiResponse.responseCode()).thenReturn(\"200\");\n    Mockito.when(apiResponses.value()).thenReturn(new ApiResponse[] {apiResponse});\n\n    apiRessProcessor.process(apiResponses, context);\n\n    Assert.assertNotNull(context.getApiResponses().get(\"200\"));\n    Assert.assertNull(context.getApiResponses().get(\"500\"));\n  }\n\n  @Test\n  public void processOperationAnnotation() throws NoSuchMethodException {\n\n    OasContext oasContext = null;\n\n    OperationMethodAnnotationProcessor operationMethodAnnotationProcessor = new OperationMethodAnnotationProcessor();\n\n    Method helloMethod = OpenapiDef.class.getDeclaredMethod(\"hello\", String.class, Object.class);\n    Operation operation = helloMethod.getAnnotation(Operation.class);\n    oasContext = new OasContext(new AbstractAnnotationParser() {\n      @Override\n      public int getOrder() {\n        return 0;\n      }\n\n      @Override\n      public boolean canProcess(Class<?> cls) {\n        return true;\n      }\n    });\n    OperationContext context = new OperationContext(helloMethod, oasContext);\n    operationMethodAnnotationProcessor.process(operation, context);\n    Assert.assertEquals(\"hello-operation\", context.getOperationId());\n  }\n\n  @Test\n  public void processOpenApiDefinitionClassAnnotation() throws NoSuchMethodException {\n\n    OasContext oasContext = null;\n\n    OpenApiDefinitionClassAnnotationProcessor openApiDefinitionClassAnnotationProcessor = new OpenApiDefinitionClassAnnotationProcessor();\n\n    OpenAPIDefinition openAPIDefinition = OpenapiDef.class.getAnnotation(OpenAPIDefinition.class);\n    oasContext = new OasContext(new AbstractAnnotationParser() {\n      @Override\n      public int getOrder() {\n        return 0;\n      }\n\n      @Override\n      public boolean canProcess(Class<?> cls) {\n        return true;\n      }\n    });\n    openApiDefinitionClassAnnotationProcessor.process(openAPIDefinition, oasContext);\n//    Assert.assertEquals(\"hello-operation\", context.getOperationId());\n  }\n\n  @Test\n  public void processRequestBodyAnnotation() throws NoSuchMethodException {\n\n    OasContext oasContext = new OasContext(null);\n    RequestBodyParamAnnotationProcessor operationMethodAnnotationProcessor = new RequestBodyParamAnnotationProcessor();\n\n    RequestBody requestBody = Mockito.mock(RequestBody.class);\n    Mockito.when(requestBody.content()).thenReturn(new Content[] {Mockito.mock(Content.class)});\n    Mockito.when(requestBody.ref()).thenReturn(\"#components/string\");\n\n    Method helloMethod = OpenapiDef.class.getDeclaredMethod(\"hello\", String.class, Object.class);\n    OperationContext operationContext = new OperationContext(helloMethod, oasContext);\n    ParameterContext parameterContext = new ParameterContext(operationContext, null);\n    operationMethodAnnotationProcessor.process(requestBody, parameterContext);\n\n    Assert.assertTrue(parameterContext.isRequestBody());\n  }\n\n  @Test\n  public void processParameterAnnotation() throws NoSuchMethodException, IllegalAccessException,\n      InstantiationException {\n\n    OasContext oasContext = new OasContext(null);\n    Method parameterMethod = ParameterClass.class.getMethod(\"parameter\", String.class);\n    OperationContext operationContext = new OperationContext(parameterMethod, oasContext);\n    java.lang.reflect.Parameter[] parameters = parameterMethod.getParameters();\n    Assert.assertEquals(parameters.length, 1);\n    java.lang.reflect.Parameter parameter = parameters[0];\n    Parameter parameterDeclaredAnnotation = parameter.getDeclaredAnnotation(Parameter.class);\n\n    ParameterContext parameterContext = new ParameterContext(operationContext, parameter);\n    ParameterAnnotationProcessor parameterAnnotationProcessor = new ParameterAnnotationProcessor();\n\n    parameterAnnotationProcessor.process(parameterDeclaredAnnotation, parameterContext);\n    io.swagger.v3.oas.models.parameters.Parameter oasParameter = parameterContext.toParameter();\n    Assert.assertEquals(\"param\", oasParameter.getName());\n    Assert.assertEquals(StringSchema.class, oasParameter.getSchema().getClass());\n    Assert.assertTrue(parameterContext.isRequired());\n    Assert.assertEquals(operationContext, parameterContext.getOperationContext());\n    Assert.assertNull(parameterContext.getDefaultValue());\n  }\n\n  class ParameterClass {\n    public void parameter(@Parameter(required = true) String param) {\n    }\n  }\n\n  @OpenAPIDefinition(\n      info = @Info(\n          title = \"openapi definition\",\n          description = \"test openapi definition\",\n          termsOfService = \"\",\n          contact = @Contact(\n              name = \"developer\",\n              url = \"developer.com\",\n              email = \"developer@developer.com\",\n              extensions = {\n                  @Extension(\n                      name = \"ext1\",\n                      properties = {\n                          @ExtensionProperty(\n                              name = \"k1\",\n                              value = \"v1\",\n                              parseValue = true\n                          )\n                      })\n              }\n          ),\n          license = @License(\n              name = \"Apache License v2.0\",\n              url = \"\",\n              extensions = {\n                  @Extension(\n                      name = \"ext2\",\n                      properties = {\n                          @ExtensionProperty(\n                              name = \"k1\",\n                              value = \"v1\",\n                              parseValue = true\n                          )\n                      }\n                  )\n              }\n          ),\n          version = \"0.2.0\",\n          extensions = {\n              @Extension(\n                  name = \"ext3\",\n                  properties = {\n                      @ExtensionProperty(\n                          name = \"k1\",\n                          value = \"v2\"\n                      )\n                  }\n              )\n          }\n      ),\n      tags = {\n          @Tag(\n              name = \"\",\n              description = \"\",\n              externalDocs = @ExternalDocumentation(\n                  description = \"\",\n                  url = \"\",\n                  extensions = {\n                      @Extension(\n                          name = \"ext4\",\n                          properties = {\n                              @ExtensionProperty(\n                                  name = \"k1\",\n                                  value = \"v2\"\n                              )\n                          }\n                      )\n                  }\n              )\n          )\n      },\n      servers = {\n          @Server(\n              url = \"http://localhost\",\n              description = \"\",\n              variables = {\n                  @ServerVariable(\n                      name = \"\",\n                      description = \"\",\n                      defaultValue = \"\",\n                      allowableValues = {},\n                      extensions = {\n                          @Extension(\n                              name = \"\",\n                              properties = @ExtensionProperty(\n                                  name = \"\",\n                                  value = \"\",\n                                  parseValue = true\n                              )\n                          )\n                      }\n                  )\n              }\n          )\n      },\n      security = {},\n      externalDocs = @ExternalDocumentation(\n          description = \"\",\n          url = \"\",\n          extensions = {\n              @Extension(\n                  name = \"\",\n                  properties = @ExtensionProperty(\n                      name = \"\",\n                      value = \"\",\n                      parseValue = true\n                  )\n              )\n          }\n      ),\n      extensions = {\n          @Extension(\n              name = \"\",\n              properties = @ExtensionProperty(\n                  name = \"\",\n                  value = \"\",\n                  parseValue = true\n              )\n          )\n      }\n  )\n  class OpenapiDef {\n\n    @Operation(\n        operationId = \"hello-operation\",\n        method = \"GET\",\n        tags = {\n            \"OpenapiDef\"\n        },\n        summary = \"\",\n        requestBody = @RequestBody(\n\n        ),\n        externalDocs = @ExternalDocumentation(),\n        parameters = {\n            @Parameter(\n                name = \"name123\",\n                in = ParameterIn.QUERY,\n                description = \"user name\",\n                required = true,\n                deprecated = false,\n                allowEmptyValue = true,\n                style = ParameterStyle.SIMPLE,\n                explode = Explode.DEFAULT,\n                allowReserved = true,\n                // Ignored if the properties content or array are specified\n                schema = @Schema(\n                    type = \"string\"\n                ),\n                hidden = false,\n                example = \"\",\n                examples = {\n                    @ExampleObject\n                },\n                extensions = {},\n                ref = \"\"\n            )\n        },\n        responses = {\n            @ApiResponse(\n                description = \"success\",\n                responseCode = \"200\",\n                headers = {\n                    @Header(name = \"Content-Type\",\n                        description = \"content type\",\n                        schema = @Schema(\n                            implementation = String.class\n                        ),\n                        required = true,\n                        deprecated = false\n                    )\n                },\n                links = {\n                    @Link()\n                },\n                content = {\n                    @Content()\n                },\n                extensions = {\n                    @Extension(\n                        name = \"\",\n                        properties = {}\n                    )\n                }\n\n            )\n        },\n        deprecated = false,\n        security = {\n            @SecurityRequirement(\n                name = \"oauth2\",\n                scopes = {\n                    \"app1\"\n                }\n            )\n        },\n        servers = {\n            @Server(\n                url = \"http://localhost:8080/hello\"\n            )\n        },\n        extensions = {\n            @Extension(\n                name = \"\",\n                properties = {}\n            )\n        },\n        hidden = false,\n        ignoreJsonView = false\n    )\n    public String hello(String name, Object notParameter) {\n      return \"hello\";\n    }\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/test/java/org/apache/servicecomb/toolkit/generator/ContextTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertNotNull;\nimport static org.junit.Assert.assertNull;\nimport static org.junit.Assert.assertTrue;\n\nimport java.lang.reflect.Method;\nimport java.lang.reflect.Parameter;\nimport java.util.Collections;\n\nimport org.apache.servicecomb.toolkit.generator.AnnotationProcessorTest.OpenapiDef;\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\nimport org.junit.Test;\n\nimport io.swagger.v3.oas.annotations.enums.ParameterStyle;\nimport io.swagger.v3.oas.models.PathItem.HttpMethod;\nimport io.swagger.v3.oas.models.parameters.RequestBody;\nimport io.swagger.v3.oas.models.responses.ApiResponses;\n\npublic class ContextTest {\n\n  @Test\n  public void realParameterContext() throws NoSuchMethodException {\n    Method method = OpenapiDef.class.getDeclaredMethod(\"hello\", String.class, Object.class);\n    OasContext oasContext = new OasContext(null);\n    OperationContext operationContext = new OperationContext(method, oasContext);\n\n    Parameter parameter = method.getParameters()[0];\n    ParameterContext context = new ParameterContext(operationContext, parameter);\n    context.setRequired(true);\n    context.setSchema(null);\n\n    assertTrue(context.isRequired());\n    context.setDefaultValue(\"default\");\n    context.setIn(InType.QUERY);\n    context.setName(\"param1\");\n    context.setDescription(\"desc\");\n    context.setStyle(ParameterStyle.SIMPLE);\n    context.addExtension(\"extension-key\", \"extension-value\");\n\n    assertFalse(context.isRequestBody());\n\n    context.toParameter();\n    context.applyAnnotations(Collections.emptyList());\n\n    assertEquals(\"param1\", context.getName());\n    assertEquals(InType.QUERY, context.getIn());\n    assertEquals(String.class, context.getRealType());\n    assertEquals(String.class, context.getType());\n    assertEquals(operationContext.getComponents(), context.getComponents());\n    assertEquals(operationContext, context.getOperationContext());\n    assertNull(context.getExtensions());\n    assertNotNull(context.getOasParameter());\n    assertNull(context.getParser());\n    assertEquals(parameter, context.getParameter());\n    assertNotNull(context.getSchema());\n    assertEquals(\"default\", context.getDefaultValue());\n    assertEquals(\"desc\", context.getDescription());\n    assertEquals(ParameterStyle.SIMPLE, context.getStyle());\n    assertFalse(context.isRequired());\n    assertNull(context.getDeprecated());\n\n    context.setIn(InType.COOKIE);\n    assertFalse(context.isRequestBody());\n    context.toParameter();\n\n    context.setIn(InType.HEADER);\n    assertFalse(context.isRequestBody());\n    context.toParameter();\n\n    context.setIn(InType.PATH);\n    assertFalse(context.isRequestBody());\n    context.toParameter();\n\n    context.setIn(InType.FORM);\n    assertTrue(context.isRequestBody());\n    context.toParameter();\n\n    context.setIn(InType.BODY);\n    context.toParameter();\n    assertTrue(context.isRequestBody());\n\n    context.addConsume(MediaTypes.APPLICATION_JSON);\n    assertEquals(MediaTypes.APPLICATION_JSON, context.getConsumers().get(0));\n\n    context.setRequestBody(new RequestBody());\n    assertNotNull(context.getRequestBody());\n  }\n\n  @Test\n  public void operationContext() throws NoSuchMethodException {\n    Method method = OpenapiDef.class.getDeclaredMethod(\"hello\", String.class, Object.class);\n    OasContext oasContext = new OasContext(null);\n    OperationContext operationContext = new OperationContext(method, oasContext);\n    Parameter parameter = method.getParameters()[0];\n    ParameterContext context = new ParameterContext(operationContext, parameter);\n    context.setIn(InType.FORM);\n    oasContext.toOpenAPI();\n    operationContext.setHttpMethod(HttpMethod.GET.name());\n    operationContext.setTags(null);\n    operationContext.setApiResponses(new ApiResponses());\n    operationContext.setDescription(\"desc\");\n    operationContext.setConsumers(new String[] {MediaTypes.APPLICATION_JSON});\n    operationContext.addExtension(\"x-extension\", \"value\");\n    operationContext.toOperation();\n    oasContext.toOpenAPI();\n    oasContext.addExtension(\"x-extension\", \"value\");\n\n    assertEquals(\"value\", oasContext.getExtensions().get(\"x-extension\"));\n    assertEquals(\"value\", operationContext.getExtensions().get(\"x-extension\"));\n    assertEquals(HttpMethod.GET.name(), operationContext.getHttpMethod());\n    assertNotNull(operationContext.getOperation());\n    assertNotNull(operationContext.getApiResponses());\n    assertEquals(oasContext, operationContext.getOpenApiContext());\n    assertNull(operationContext.getSummary());\n    assertNull(operationContext.getTags());\n    assertEquals(MediaTypes.APPLICATION_JSON, operationContext.getConsumers()[0]);\n    assertEquals(\"desc\", operationContext.getDescription());\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/test/java/org/apache/servicecomb/toolkit/generator/OasGeneratorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator;\n\nimport java.lang.reflect.Method;\nimport java.lang.reflect.Parameter;\nimport java.util.HashSet;\nimport java.util.Set;\n\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\nimport org.apache.servicecomb.toolkit.generator.context.OasGenerator;\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\nimport org.junit.Assert;\nimport org.junit.Test;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.PathItem.HttpMethod;\n\npublic class OasGeneratorTest {\n\n  @Test\n  public void generatorOas() {\n\n    Set<Class> classSet = new HashSet<>();\n    classSet.add(NoResource.class);\n    classSet.add(OneResource.class);\n    OasGenerator generator = new OasGenerator();\n    generator.generate(classSet);\n  }\n\n  @Test\n  public void constructOasContext() throws NoSuchMethodException {\n    OasContext oasContext = new OasContext(null);\n\n    Method method = OneResource.class.getMethod(\"name\", String.class);\n    OperationContext operationContext = new OperationContext(method, oasContext);\n    operationContext.setHttpMethod(HttpMethod.GET.name());\n    operationContext.setOperationId(method.getName());\n    operationContext.setPath(\"/operation\");\n\n    oasContext.addOperation(operationContext);\n    oasContext.setCls(method.getDeclaringClass());\n    oasContext.setBasePath(\"/oas\");\n    oasContext.setParser(null);\n\n    Assert.assertEquals(\"/oas\", oasContext.getBasePath());\n    Assert.assertEquals(method.getDeclaringClass(), oasContext.getCls());\n    Assert.assertNull(oasContext.getParser());\n\n    Assert.assertEquals(\"/operation\", operationContext.getPath());\n    Assert.assertEquals(HttpMethod.GET.name(), operationContext.getHttpMethod());\n    Assert.assertEquals(oasContext.getComponents(), operationContext.getComponents());\n    Assert.assertEquals(null, operationContext.getApiResponses().getDefault());\n    Assert.assertEquals(oasContext.getOpenAPI(), operationContext.getOpenAPI());\n\n    Parameter parameter = method.getParameters()[0];\n    ParameterContext parameterContext = new ParameterContext(operationContext, parameter);\n    parameterContext.setName(parameter.getName());\n    parameterContext.setRequired(true);\n    parameterContext.setIn(InType.QUERY);\n\n    Assert.assertEquals(parameter.getName(), parameterContext.getName());\n\n    OpenAPI openAPI = oasContext.toOpenAPI();\n    Assert.assertNotNull(openAPI);\n  }\n\n  class NoResource {\n\n  }\n\n  class OneResource {\n    public String name(String name) {\n      return name;\n    }\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/test/java/org/apache/servicecomb/toolkit/generator/ParserTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator;\n\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\nimport org.apache.servicecomb.toolkit.generator.parser.AbstractAnnotationParser;\nimport org.junit.Test;\n\nimport io.swagger.v3.oas.annotations.OpenAPIDefinition;\nimport io.swagger.v3.oas.annotations.responses.ApiResponse;\n\npublic class ParserTest {\n\n  @Test\n  public void parse() {\n    AbstractAnnotationParser parser = new TestParser();\n\n    parser.parser(UnParser.class, new OasContext(parser));\n  }\n\n  class TestParser extends AbstractAnnotationParser {\n\n    @Override\n    public int getOrder() {\n      return 0;\n    }\n\n    @Override\n    public boolean canProcess(Class<?> cls) {\n      return true;\n    }\n  }\n\n  @OpenAPIDefinition\n  class UnParser {\n    @ApiResponse\n    public String name(String name) {\n      return name;\n    }\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-core/src/test/java/org/apache/servicecomb/toolkit/generator/UtilsTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator;\n\nimport static org.mockito.Mockito.when;\n\nimport java.lang.reflect.Method;\nimport java.lang.reflect.Parameter;\nimport java.lang.reflect.Type;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.generator.annotation.ModelInterceptor;\nimport org.apache.servicecomb.toolkit.generator.util.ModelConverter;\nimport org.apache.servicecomb.toolkit.generator.util.ParamUtils;\nimport org.apache.servicecomb.toolkit.generator.util.RequestResponse;\nimport org.apache.servicecomb.toolkit.generator.util.SwaggerAnnotationUtils;\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.mockito.Mockito;\n\nimport io.swagger.v3.oas.annotations.media.Content;\nimport io.swagger.v3.oas.annotations.media.Encoding;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.media.ArraySchema;\nimport io.swagger.v3.oas.models.media.Schema;\nimport io.swagger.v3.oas.models.media.StringSchema;\n\npublic class UtilsTest {\n\n  @Test\n  public void getParameterName() throws NoSuchMethodException {\n\n    Method method = ParameterClass.class.getMethod(\"method\", String.class);\n    Parameter parameter = method.getParameters()[0];\n    String parameterName = ParamUtils.getParameterName(method, parameter);\n    Assert.assertEquals(\"param\", parameterName);\n  }\n\n  @Test\n  public void getSchema() {\n    Schema schema = ModelConverter.getSchema(String.class);\n    Assert.assertEquals(StringSchema.class, schema.getClass());\n\n    schema = ModelConverter.getSchema(ParameterClass.class);\n    Assert.assertEquals(Schema.class, schema.getClass());\n\n    schema = ModelConverter.getSchema(String[].class);\n    Assert.assertEquals(ArraySchema.class, schema.getClass());\n\n    Components components = new Components();\n    schema = ModelConverter.getSchema(ParameterClass[].class, components, null);\n    Assert.assertEquals(ArraySchema.class, schema.getClass());\n\n    schema = ModelConverter.getSchema(ParameterClass.class, components, null);\n    Assert.assertNotNull(schema.get$ref());\n\n    ModelInterceptor mockModelInterceptor = new ModelInterceptor() {\n      @Override\n      public int order() {\n        return 0;\n      }\n\n      @Override\n      public Schema process(Type cls, Components components) {\n        return new Schema().name(\"unknown\");\n      }\n    };\n\n    ModelConverter.registerInterceptor(mockModelInterceptor);\n    schema = ModelConverter.getSchema(ParameterClass.class);\n    Assert.assertEquals(\"unknown\", schema.getName());\n    ModelConverter.unRegisterInterceptor(mockModelInterceptor);\n\n    Components component = new Components();\n    ModelConverter.getSchema(BeanClass.class, component, RequestResponse.REQUEST);\n    Assert.assertNotNull(component.getSchemas().get(\"Value\"));\n\n    Schema beanClass = component.getSchemas().get(\"BeanClass\");\n    Assert.assertNotNull(beanClass);\n    Schema valueRef = (Schema) beanClass.getProperties().get(\"value\");\n    Assert.assertEquals(\"#/components/schemas/Value\", valueRef.get$ref());\n\n    Schema intVal = (Schema) beanClass.getProperties().get(\"intVal\");\n    Assert.assertEquals(\"int32\", intVal.getFormat());\n    Assert.assertEquals(\"integer\", intVal.getType());\n\n    Schema intObj = (Schema) beanClass.getProperties().get(\"intObj\");\n    Assert.assertEquals(\"int32\", intObj.getFormat());\n    Assert.assertEquals(\"integer\", intObj.getType());\n\n    Schema longVal = (Schema) beanClass.getProperties().get(\"longVal\");\n    Assert.assertEquals(\"int64\", longVal.getFormat());\n    Assert.assertEquals(\"integer\", longVal.getType());\n\n    Schema longObj = (Schema) beanClass.getProperties().get(\"longObj\");\n    Assert.assertEquals(\"int64\", longObj.getFormat());\n    Assert.assertEquals(\"integer\", longObj.getType());\n\n    Schema doubleVal = (Schema) beanClass.getProperties().get(\"doubleVal\");\n    Assert.assertEquals(\"double\", doubleVal.getFormat());\n    Assert.assertEquals(\"number\", doubleVal.getType());\n\n    Schema doubleObj = (Schema) beanClass.getProperties().get(\"doubleObj\");\n    Assert.assertEquals(\"double\", doubleObj.getFormat());\n    Assert.assertEquals(\"number\", doubleObj.getType());\n\n    Schema props = (Schema) beanClass.getProperties().get(\"props\");\n    Assert.assertEquals(ArraySchema.class, props.getClass());\n    Assert.assertEquals(\"array\", props.getType());\n    Assert.assertEquals(\"string\", ((ArraySchema) props).getItems().getType());\n\n    Schema numbers = (Schema) beanClass.getProperties().get(\"numbers\");\n    Assert.assertEquals(ArraySchema.class, numbers.getClass());\n    Assert.assertEquals(\"array\", numbers.getType());\n    Assert.assertEquals(\"integer\", ((ArraySchema) numbers).getItems().getType());\n    Assert.assertEquals(\"int32\", ((ArraySchema) numbers).getItems().getFormat());\n\n    Schema values = (Schema) beanClass.getProperties().get(\"values\");\n    Assert.assertEquals(ArraySchema.class, values.getClass());\n    Assert.assertEquals(\"array\", values.getType());\n    Assert.assertEquals(\"#/components/schemas/Value\", ((ArraySchema) values).getItems().get$ref());\n  }\n\n  @Test\n  public void getRequestOrResponseBean() {\n\n    List<Type> requestBeanTypes = ModelConverter.getRequestBeanTypes(RequestBeanClass.class);\n    List<Type> responseBeanTypes = ModelConverter.getResponseBeanTypes(ResponseBeanClass.class);\n\n    Assert.assertNotNull(requestBeanTypes);\n    Assert.assertNotNull(responseBeanTypes);\n\n    Assert.assertEquals(1, requestBeanTypes.size());\n    Assert.assertEquals(\"Value\", ((Class) requestBeanTypes.get(0)).getSimpleName());\n    Assert.assertEquals(1, responseBeanTypes.size());\n    Assert.assertEquals(\"Value\", ((Class) responseBeanTypes.get(0)).getSimpleName());\n  }\n\n  @Test\n  public void getContentFromAnnotation() {\n    Content contents = Mockito.mock(Content.class);\n    when(contents.encoding()).thenReturn(new Encoding[] {Mockito.mock(Encoding.class)});\n    List<io.swagger.v3.oas.models.media.Content> contentFromAnnotation = SwaggerAnnotationUtils\n        .getContentFromAnnotation(contents);\n\n    Assert.assertEquals(1, contentFromAnnotation.size());\n  }\n\n  class RequestBeanClass {\n\n    public void setValue(Value value) {\n    }\n\n    public void setName(String name, String alias) {\n    }\n\n    public Integer getSomething() {\n      return 0;\n    }\n  }\n\n  class ResponseBeanClass {\n\n    public Value getValue() {\n      return new Value();\n    }\n\n    public String getName(String name) {\n      return name;\n    }\n\n    public void setSomething(Integer something) {\n    }\n  }\n\n  class ParameterClass {\n    public void method(String param) {\n    }\n  }\n\n  class BeanClass {\n\n    private String name;\n\n    private int intVal;\n\n    private long longVal;\n\n    private double doubleVal;\n\n    private Integer intObj;\n\n    private Long longObj;\n\n    private Double doubleObj;\n\n    private Value value;\n\n    List<String> props;\n\n    List<Integer> numbers;\n\n    List<Value> values;\n\n    List list;\n\n    public List getList() {\n      return list;\n    }\n\n    public void setList(List list) {\n      this.list = list;\n    }\n\n    public int getIntVal() {\n      return intVal;\n    }\n\n    public void setIntVal(int intVal) {\n      this.intVal = intVal;\n    }\n\n    public long getLongVal() {\n      return longVal;\n    }\n\n    public void setLongVal(long longVal) {\n      this.longVal = longVal;\n    }\n\n    public double getDoubleVal() {\n      return doubleVal;\n    }\n\n    public void setDoubleVal(double doubleVal) {\n      this.doubleVal = doubleVal;\n    }\n\n    public Integer getIntObj() {\n      return intObj;\n    }\n\n    public void setIntObj(Integer intObj) {\n      this.intObj = intObj;\n    }\n\n    public Long getLongObj() {\n      return longObj;\n    }\n\n    public void setLongObj(Long longObj) {\n      this.longObj = longObj;\n    }\n\n    public Double getDoubleObj() {\n      return doubleObj;\n    }\n\n    public void setDoubleObj(Double doubleObj) {\n      this.doubleObj = doubleObj;\n    }\n\n    public List<Value> getValues() {\n      return values;\n    }\n\n    public void setValues(List<Value> values) {\n      this.values = values;\n    }\n\n    public List<Integer> getNumbers() {\n      return numbers;\n    }\n\n    public void setNumbers(List<Integer> numbers) {\n      this.numbers = numbers;\n    }\n\n    public List<String> getProps() {\n      return props;\n    }\n\n    public void setProps(List<String> props) {\n      this.props = props;\n    }\n\n    public String getName() {\n      return name;\n    }\n\n    public void setName(String name) {\n      this.name = name;\n    }\n\n    public Value getValue() {\n      return value;\n    }\n\n    public void setValue(Value value) {\n      this.value = value;\n    }\n  }\n\n  class Value {\n    private String prop1;\n\n    private String prop2;\n\n    public String getProp1() {\n      return prop1;\n    }\n\n    public void setProp1(String prop1) {\n      this.prop1 = prop1;\n    }\n\n    public String getProp2() {\n      return prop2;\n    }\n\n    public void setProp2(String prop2) {\n      this.prop2 = prop2;\n    }\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>oas-generator</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>oas-generator-jaxrs</artifactId>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-generator-core</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>javax.ws.rs</groupId>\n      <artifactId>javax.ws.rs-api</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>junit</groupId>\n      <artifactId>junit</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.powermock</groupId>\n      <artifactId>powermock-module-junit4</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.powermock</groupId>\n      <artifactId>powermock-api-mockito</artifactId>\n      <scope>test</scope>\n    </dependency>\n  </dependencies>\n</project>"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/ConsumesAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport javax.ws.rs.Consumes;\n\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\n\npublic class ConsumesAnnotationProcessor implements MethodAnnotationProcessor<Consumes, OperationContext> {\n  @Override\n  public void process(Consumes consumes, OperationContext operationContext) {\n    operationContext.setConsumers(consumes.value());\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/CookieParamAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport javax.ws.rs.CookieParam;\n\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\n\npublic class CookieParamAnnotationProcessor implements ParamAnnotationProcessor<CookieParam, ParameterContext> {\n  @Override\n  public void process(CookieParam cookieParam, ParameterContext parameterContext) {\n    parameterContext.setIn(InType.COOKIE);\n    parameterContext.setName(cookieParam.value());\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/FormParamAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport javax.ws.rs.FormParam;\n\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\n\npublic class FormParamAnnotationProcessor implements ParamAnnotationProcessor<FormParam, ParameterContext> {\n  @Override\n  public void process(FormParam formParam, ParameterContext parameterContext) {\n\n    parameterContext.setIn(InType.FORM);\n    parameterContext.setName(formParam.value());\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/HeaderParamAnnotationProcessor.java",
    "content": "\n/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport javax.ws.rs.HeaderParam;\n\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\n\npublic class HeaderParamAnnotationProcessor implements ParamAnnotationProcessor<HeaderParam, ParameterContext> {\n  @Override\n  public void process(HeaderParam headerParam, ParameterContext parameterContext) {\n    parameterContext.setIn(InType.HEADER);\n    parameterContext.setName(headerParam.value());\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/HttpMethodAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport java.lang.annotation.Annotation;\n\nimport javax.ws.rs.HttpMethod;\n\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\n\npublic class HttpMethodAnnotationProcessor implements MethodAnnotationProcessor<Annotation, OperationContext> {\n  @Override\n  public void process(Annotation annotation, OperationContext operationContext) {\n    HttpMethod httpMethod = annotation.annotationType().getAnnotation(HttpMethod.class);\n    operationContext.setHttpMethod(httpMethod.value());\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/PathClassAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport javax.ws.rs.Path;\n\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\n\npublic class PathClassAnnotationProcessor implements ClassAnnotationProcessor<Path, OasContext> {\n  @Override\n  public void process(Path path, OasContext context) {\n    context.setBasePath(path.value());\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/PathMethodAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport javax.ws.rs.Path;\n\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\n\npublic class PathMethodAnnotationProcessor implements MethodAnnotationProcessor<Path, OperationContext> {\n  @Override\n  public void process(Path path, OperationContext context) {\n    context.setPath(path.value());\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/PathParamAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport javax.ws.rs.PathParam;\n\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\n\npublic class PathParamAnnotationProcessor implements ParamAnnotationProcessor<PathParam, ParameterContext> {\n  @Override\n  public void process(PathParam pathParam, ParameterContext context) {\n    context.setIn(InType.PATH);\n    context.setName(pathParam.value());\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/QueryParamAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport javax.ws.rs.QueryParam;\n\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\n\npublic class QueryParamAnnotationProcessor implements ParamAnnotationProcessor<QueryParam, ParameterContext> {\n  @Override\n  public void process(QueryParam queryParam, ParameterContext parameterContext) {\n    parameterContext.setIn(InType.QUERY);\n    parameterContext.setName(queryParam.value());\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/src/main/java/org/apache/servicecomb/toolkit/generator/parser/JaxRsAnnotationParser.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.parser;\n\nimport javax.ws.rs.Consumes;\nimport javax.ws.rs.CookieParam;\nimport javax.ws.rs.DELETE;\nimport javax.ws.rs.FormParam;\nimport javax.ws.rs.GET;\nimport javax.ws.rs.HEAD;\nimport javax.ws.rs.OPTIONS;\nimport javax.ws.rs.PATCH;\nimport javax.ws.rs.POST;\nimport javax.ws.rs.PUT;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.PathParam;\nimport javax.ws.rs.QueryParam;\n\nimport org.apache.servicecomb.toolkit.generator.annotation.ConsumesAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.CookieParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.FormParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.HeaderParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.HttpMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.PathClassAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.PathMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.PathParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.QueryParamAnnotationProcessor;\n\nimport io.swagger.v3.oas.annotations.headers.Header;\n\npublic class JaxRsAnnotationParser extends AbstractAnnotationParser {\n\n  @Override\n  public void initClassAnnotationProcessor() {\n    super.initClassAnnotationProcessor();\n    classAnnotationMap.put(Path.class, new PathClassAnnotationProcessor());\n  }\n\n  @Override\n  public void initMethodAnnotationProcessor() {\n    super.initMethodAnnotationProcessor();\n    methodAnnotationMap.put(Path.class, new PathMethodAnnotationProcessor());\n\n    HttpMethodAnnotationProcessor httpMethodAnnotationProcessor = new HttpMethodAnnotationProcessor();\n    methodAnnotationMap.put(GET.class, httpMethodAnnotationProcessor);\n    methodAnnotationMap.put(POST.class, httpMethodAnnotationProcessor);\n    methodAnnotationMap.put(DELETE.class, httpMethodAnnotationProcessor);\n    methodAnnotationMap.put(PATCH.class, httpMethodAnnotationProcessor);\n    methodAnnotationMap.put(PUT.class, httpMethodAnnotationProcessor);\n    methodAnnotationMap.put(OPTIONS.class, httpMethodAnnotationProcessor);\n    methodAnnotationMap.put(HEAD.class, httpMethodAnnotationProcessor);\n    methodAnnotationMap.put(Consumes.class, new ConsumesAnnotationProcessor());\n  }\n\n  @Override\n  public void initParameterAnnotationProcessor() {\n    super.initParameterAnnotationProcessor();\n\n    parameterAnnotationMap.put(QueryParam.class, new QueryParamAnnotationProcessor());\n    parameterAnnotationMap.put(CookieParam.class, new CookieParamAnnotationProcessor());\n    parameterAnnotationMap.put(FormParam.class, new FormParamAnnotationProcessor());\n    parameterAnnotationMap.put(PathParam.class, new PathParamAnnotationProcessor());\n    parameterAnnotationMap.put(Header.class, new HeaderParamAnnotationProcessor());\n  }\n\n  @Override\n  public int getOrder() {\n    return 100;\n  }\n\n  @Override\n  public boolean canProcess(Class<?> cls) {\n\n    if (cls.getAnnotation(Path.class) != null) {\n      return true;\n    }\n    return false;\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/src/main/resources/META-INF/services/org.apache.servicecomb.toolkit.generator.parser.api.OpenApiAnnotationParser",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\norg.apache.servicecomb.toolkit.generator.parser.JaxRsAnnotationParser"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/src/test/java/org/apache/servicecomb/toolkit/generator/JaxrsAnnotationProcessorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator;\n\nimport javax.ws.rs.Consumes;\nimport javax.ws.rs.CookieParam;\nimport javax.ws.rs.FormParam;\nimport javax.ws.rs.GET;\nimport javax.ws.rs.HeaderParam;\nimport javax.ws.rs.HttpMethod;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.PathParam;\nimport javax.ws.rs.QueryParam;\n\nimport org.apache.servicecomb.toolkit.generator.annotation.AnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.ConsumesAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.CookieParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.FormParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.HeaderParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.HttpMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.PathClassAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.PathMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.PathParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.QueryParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.mockito.Mockito;\n\npublic class JaxrsAnnotationProcessorTest {\n\n  @Test\n  public void processApiResponseAnnotation() throws NoSuchMethodException {\n\n    OasContext oasContext = new OasContext(null);\n    OperationContext context = new OperationContext(null, oasContext);\n    HttpMethodAnnotationProcessor httpMethodAnnotationProcessor = new HttpMethodAnnotationProcessor();\n\n    GET get = GetClass.class.getMethod(\"get\").getAnnotation(GET.class);\n    httpMethodAnnotationProcessor.process(get, context);\n\n    Assert.assertEquals(HttpMethod.GET, context.getHttpMethod());\n  }\n\n  @Test\n  public void processPathClassAnnotation() {\n\n    OasContext oasContext = new OasContext(null);\n    PathClassAnnotationProcessor httpMethodAnnotationProcessor = new PathClassAnnotationProcessor();\n\n    Path path = Mockito.mock(Path.class);\n    Mockito.when(path.value()).thenReturn(\"/path\");\n    httpMethodAnnotationProcessor.process(path, oasContext);\n\n    Assert.assertEquals(\"/path\", oasContext.getBasePath());\n  }\n\n  @Test\n  public void processPathMethodAnnotation() {\n\n    OasContext oasContext = new OasContext(null);\n    OperationContext operationContext = new OperationContext(null, oasContext);\n    PathMethodAnnotationProcessor pathMethodAnnotationProcessor = new PathMethodAnnotationProcessor();\n\n    Path path = Mockito.mock(Path.class);\n    Mockito.when(path.value()).thenReturn(\"/path\");\n    pathMethodAnnotationProcessor.process(path, operationContext);\n\n    Assert.assertEquals(\"/path\", operationContext.getPath());\n  }\n\n  @Test\n  public void processConsumersAnnotation() {\n\n    OasContext oasContext = new OasContext(null);\n    OperationContext operationContext = new OperationContext(null, oasContext);\n    AnnotationProcessor annotationProcessor = new ConsumesAnnotationProcessor();\n\n    Consumes consumes = Mockito.mock(Consumes.class);\n    Mockito.when(consumes.value()).thenReturn(new String[] {MediaTypes.APPLICATION_JSON});\n    annotationProcessor.process(consumes, operationContext);\n\n    Assert.assertEquals(MediaTypes.APPLICATION_JSON, operationContext.getConsumers()[0]);\n  }\n\n  @Test\n  public void processCookieParamAnnotation() {\n\n    OasContext oasContext = new OasContext(null);\n    OperationContext operationContext = new OperationContext(null, oasContext);\n    ParameterContext parameterContext = new ParameterContext(operationContext, null);\n    AnnotationProcessor annotationProcessor = new CookieParamAnnotationProcessor();\n\n    CookieParam cookieParam = Mockito.mock(CookieParam.class);\n    Mockito.when(cookieParam.value()).thenReturn(\"param\");\n    annotationProcessor.process(cookieParam, parameterContext);\n\n    Assert.assertEquals(\"param\", parameterContext.getName());\n  }\n\n  @Test\n  public void processFormParamAnnotation() {\n\n    OasContext oasContext = new OasContext(null);\n    OperationContext operationContext = new OperationContext(null, oasContext);\n    ParameterContext parameterContext = new ParameterContext(operationContext, null);\n    AnnotationProcessor annotationProcessor = new FormParamAnnotationProcessor();\n\n    FormParam formParam = Mockito.mock(FormParam.class);\n    Mockito.when(formParam.value()).thenReturn(\"param\");\n    annotationProcessor.process(formParam, parameterContext);\n\n    Assert.assertEquals(\"param\", parameterContext.getName());\n    Assert.assertTrue(parameterContext.isRequestBody());\n  }\n\n  @Test\n  public void processHeaderParamAnnotation() {\n\n    OasContext oasContext = new OasContext(null);\n    OperationContext operationContext = new OperationContext(null, oasContext);\n    ParameterContext parameterContext = new ParameterContext(operationContext, null);\n    AnnotationProcessor annotationProcessor = new HeaderParamAnnotationProcessor();\n\n    HeaderParam headerParam = Mockito.mock(HeaderParam.class);\n    Mockito.when(headerParam.value()).thenReturn(\"param\");\n    annotationProcessor.process(headerParam, parameterContext);\n\n    Assert.assertEquals(\"param\", parameterContext.getName());\n    Assert.assertFalse(parameterContext.isRequestBody());\n  }\n\n  @Test\n  public void processPathParamAnnotation() {\n\n    OasContext oasContext = new OasContext(null);\n    OperationContext operationContext = new OperationContext(null, oasContext);\n    ParameterContext parameterContext = new ParameterContext(operationContext, null);\n    AnnotationProcessor annotationProcessor = new PathParamAnnotationProcessor();\n\n    PathParam pathParam = Mockito.mock(PathParam.class);\n    Mockito.when(pathParam.value()).thenReturn(\"param\");\n    annotationProcessor.process(pathParam, parameterContext);\n\n    Assert.assertEquals(\"param\", parameterContext.getName());\n    Assert.assertFalse(parameterContext.isRequestBody());\n  }\n\n\n  @Test\n  public void processQueryParamAnnotation() {\n\n    OasContext oasContext = new OasContext(null);\n    OperationContext operationContext = new OperationContext(null, oasContext);\n    ParameterContext parameterContext = new ParameterContext(operationContext, null);\n    AnnotationProcessor annotationProcessor = new QueryParamAnnotationProcessor();\n\n    QueryParam queryParam = Mockito.mock(QueryParam.class);\n    Mockito.when(queryParam.value()).thenReturn(\"param\");\n    annotationProcessor.process(queryParam, parameterContext);\n\n    Assert.assertEquals(\"param\", parameterContext.getName());\n    Assert.assertFalse(parameterContext.isRequestBody());\n  }\n\n  class GetClass {\n    @GET\n    public String get() {\n      return \"get\";\n    }\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-jaxrs/src/test/java/org/apache/servicecomb/toolkit/generator/JaxrsParserTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator;\n\nimport javax.ws.rs.Path;\n\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\nimport org.apache.servicecomb.toolkit.generator.parser.JaxRsAnnotationParser;\nimport org.junit.Assert;\nimport org.junit.Test;\n\nimport io.swagger.v3.oas.models.Components;\n\npublic class JaxrsParserTest {\n\n  @Test\n  public void parseJaxrs() {\n\n    JaxRsAnnotationParser parser = new JaxRsAnnotationParser();\n    boolean canProcess = parser.canProcess(NoResource.class);\n    Assert.assertEquals(false, canProcess);\n\n    canProcess = parser.canProcess(OneResource.class);\n    Assert.assertEquals(true, canProcess);\n\n    OasContext context = new OasContext(parser);\n    parser.parser(OneResource.class, context);\n  }\n\n  class NoResource {\n    public String name() {\n      return \"no resource\";\n    }\n  }\n\n  @Path(\"/path\")\n  class OneResource {\n\n    @Path(\"/name\")\n    public String name() {\n      return \"no resource\";\n    }\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-servicecomb/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>oas-generator</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>oas-generator-servicecomb</artifactId>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-generator-jaxrs</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-generator-spring</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>provider-rest-common</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb</groupId>\n      <artifactId>provider-pojo</artifactId>\n      <exclusions>\n        <exclusion>\n          <groupId>commons-lang</groupId>\n          <artifactId>commons-lang</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>io.netty</groupId>\n          <artifactId>*</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>io.zipkin.brave</groupId>\n          <artifactId>*</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>io.vertx</groupId>\n          <artifactId>*</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>org.apache.servicecomb</groupId>\n          <artifactId>foundation-vertx</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>org.apache.servicecomb</groupId>\n          <artifactId>foundation-ssl</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>org.apache.servicecomb</groupId>\n          <artifactId>foundation-config</artifactId>\n        </exclusion>\n        <exclusion>\n          <groupId>org.apache.servicecomb</groupId>\n          <artifactId>deployment</artifactId>\n        </exclusion>\n      </exclusions>\n    </dependency>\n    \n    <dependency>\n      <groupId>junit</groupId>\n      <artifactId>junit</artifactId>\n      <scope>test</scope>\n    </dependency>\n    \n  </dependencies>\n\n</project>\n"
  },
  {
    "path": "oas-generator/oas-generator-servicecomb/src/main/java/org/apache/servicecomb/toolkit/generator/parser/ServicecombJaxrsParser.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.parser;\n\nimport javax.ws.rs.Path;\n\nimport org.apache.servicecomb.provider.rest.common.RestSchema;\n\npublic class ServicecombJaxrsParser extends JaxRsAnnotationParser {\n\n  @Override\n  public boolean canProcess(Class<?> cls) {\n    if (cls.getAnnotation(RestSchema.class) != null && cls.getAnnotation(Path.class) != null) {\n      return true;\n    }\n\n    return false;\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-servicecomb/src/main/java/org/apache/servicecomb/toolkit/generator/parser/ServicecombPojoParser.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.parser;\n\nimport java.lang.reflect.Method;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.provider.pojo.RpcSchema;\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\n\nimport io.swagger.v3.oas.models.PathItem.HttpMethod;\n\npublic class ServicecombPojoParser extends AbstractAnnotationParser {\n\n  @Override\n  public int getOrder() {\n    return 100;\n  }\n\n  @Override\n  public boolean canProcess(Class<?> cls) {\n    if (cls.getAnnotation(RpcSchema.class) != null) {\n      return true;\n    }\n\n    return false;\n  }\n\n\n  @Override\n  public void postParseMethodAnnotation(OperationContext context) {\n    super.postParseMethodAnnotation(context);\n\n    Method currentMethod = context.getMethod();\n\n    if (StringUtils.isEmpty(context.getHttpMethod())) {\n      context.setHttpMethod(HttpMethod.POST.toString());\n    }\n\n    if (StringUtils.isEmpty(context.getOperationId())) {\n      context.setOperationId(currentMethod.getName());\n    }\n\n    if (StringUtils.isEmpty(context.getPath())) {\n      context.setPath(correctPath(currentMethod.getName()));\n    }\n\n    if (context.getApiResponses() == null || context.getApiResponses().size() == 0) {\n      context.correctResponse(context.getApiResponses());\n    }\n  }\n\n  private String correctPath(String path) {\n    if (path == null || path.startsWith(\"/\")) {\n      return path;\n    }\n    return \"/\" + path;\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-servicecomb/src/main/java/org/apache/servicecomb/toolkit/generator/parser/ServicecombSpringmvcParser.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.parser;\n\nimport org.apache.servicecomb.provider.rest.common.RestSchema;\nimport org.springframework.web.bind.annotation.RequestMapping;\n\npublic class ServicecombSpringmvcParser extends SpringmvcAnnotationParser {\n\n  @Override\n  public boolean canProcess(Class<?> cls) {\n    if (cls.getAnnotation(RestSchema.class) != null && cls.getAnnotation(RequestMapping.class) != null) {\n      return true;\n    }\n\n    return false;\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-servicecomb/src/main/resources/META-INF/services/org.apache.servicecomb.toolkit.generator.parser.api.OpenApiAnnotationParser",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\norg.apache.servicecomb.toolkit.generator.parser.ServicecombJaxrsParser\norg.apache.servicecomb.toolkit.generator.parser.ServicecombSpringmvcParser\norg.apache.servicecomb.toolkit.generator.parser.ServicecombPojoParser"
  },
  {
    "path": "oas-generator/oas-generator-servicecomb/src/test/java/org/apache/servicecomb/toolkit/generator/ServiceCombParserTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator;\n\nimport javax.ws.rs.Path;\n\nimport org.apache.servicecomb.provider.pojo.RpcSchema;\nimport org.apache.servicecomb.provider.rest.common.RestSchema;\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\nimport org.apache.servicecomb.toolkit.generator.parser.ServicecombJaxrsParser;\nimport org.apache.servicecomb.toolkit.generator.parser.ServicecombPojoParser;\nimport org.apache.servicecomb.toolkit.generator.parser.ServicecombSpringmvcParser;\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.springframework.web.bind.annotation.RequestMapping;\n\npublic class ServiceCombParserTest {\n\n  @Test\n  public void parse() {\n\n    ServicecombJaxrsParser servicecombJaxrsParser = new ServicecombJaxrsParser();\n    ServicecombPojoParser servicecombPojoParser = new ServicecombPojoParser();\n    ServicecombSpringmvcParser servicecombSpringmvcParser = new ServicecombSpringmvcParser();\n\n    boolean canProcess = servicecombJaxrsParser.canProcess(ServicecombJaxrs.class);\n    Assert.assertTrue(canProcess);\n\n    canProcess = servicecombJaxrsParser.canProcess(ServicecombPojo.class);\n    Assert.assertFalse(canProcess);\n\n    canProcess = servicecombSpringmvcParser.canProcess(ServicecombSpringmvc.class);\n    Assert.assertTrue(canProcess);\n    canProcess = servicecombSpringmvcParser.canProcess(ServicecombPojo.class);\n    Assert.assertFalse(canProcess);\n\n    canProcess = servicecombPojoParser.canProcess(ServicecombPojo.class);\n    Assert.assertTrue(canProcess);\n    canProcess = servicecombPojoParser.canProcess(ServicecombSpringmvc.class);\n    Assert.assertFalse(canProcess);\n    Assert.assertEquals(100, servicecombPojoParser.getOrder());\n\n    OasContext pojoOasContext = new OasContext(servicecombPojoParser);\n    servicecombPojoParser.parser(ServicecombPojo.class, pojoOasContext);\n    Assert.assertNull(pojoOasContext.getBasePath());\n  }\n\n\n  @RestSchema(schemaId = \"servicecombJaxrs\")\n  @Path(\"/\")\n  class ServicecombJaxrs {\n\n    @Path(\"/path\")\n    public Object path() {\n      return null;\n    }\n  }\n\n  @RestSchema(schemaId = \"servicecombSpringmvc\")\n  @RequestMapping\n  class ServicecombSpringmvc {\n  }\n\n  @RpcSchema\n  class ServicecombPojo {\n    public Object path() {\n      return null;\n    }\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>oas-generator</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>oas-generator-spring</artifactId>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-generator-core</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-web</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>junit</groupId>\n      <artifactId>junit</artifactId>\n      <scope>test</scope>\n    </dependency>\n  </dependencies>\n\n</project>"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/MultipartFileInterceptor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator;\n\nimport java.lang.reflect.Type;\n\nimport org.apache.servicecomb.toolkit.generator.annotation.ModelInterceptor;\nimport org.apache.servicecomb.toolkit.generator.util.ModelConverter;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.media.FileSchema;\nimport io.swagger.v3.oas.models.media.Schema;\n\npublic class MultipartFileInterceptor implements ModelInterceptor {\n\n  @Override\n  public int order() {\n    return 100;\n  }\n\n  @Override\n  public Schema process(Type cls, Components components) {\n\n    if (!MultipartFile.class.equals(cls)) {\n      return null;\n    }\n\n    return new FileSchema();\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/AbstractHttpMethodMappingAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.springframework.web.bind.annotation.RequestMethod;\n\npublic abstract class AbstractHttpMethodMappingAnnotationProcessor<Annotation, Context> implements\n    MethodAnnotationProcessor<Annotation, Context> {\n\n  protected void processPath(String[] paths, OperationContext operationContext) {\n    if (null == paths || paths.length == 0) {\n      return;\n    }\n\n    if (paths.length > 1) {\n      throw new Error(String.format(\"not allowed multi path for %s:%s\",\n          operationContext.getMethod().getDeclaringClass().getName(),\n          operationContext.getMethod().getName()));\n    }\n\n    operationContext.setPath(paths[0]);\n  }\n\n  protected void processMethod(RequestMethod requestMethod, OperationContext operationContext) {\n    operationContext.setHttpMethod(requestMethod.name());\n  }\n\n  protected void processConsumes(String[] consumes, OperationContext operationContext) {\n    if (null == consumes || consumes.length == 0) {\n      return;\n    }\n\n    operationContext.setConsumers(consumes);\n  }\n\n  protected void processProduces(String[] produces, OperationContext operationContext) {\n    if (null == produces || produces.length == 0) {\n      return;\n    }\n\n    operationContext.setProduces(produces);\n  }\n\n  protected void processHeaders(String[] headers, OperationContext operationContext) {\n    if (null == headers || headers.length == 0) {\n      return;\n    }\n    operationContext.setHeaders(headers);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/DeleteMappingMethodAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.springframework.web.bind.annotation.DeleteMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\n\npublic class DeleteMappingMethodAnnotationProcessor extends\n    AbstractHttpMethodMappingAnnotationProcessor<DeleteMapping, OperationContext> {\n\n  @Override\n  public void process(DeleteMapping deleteMapping, OperationContext operationContext) {\n    processPath(deleteMapping.path(), operationContext);\n    processPath(deleteMapping.value(), operationContext);\n    processMethod(RequestMethod.DELETE, operationContext);\n    processConsumes(deleteMapping.consumes(), operationContext);\n    processProduces(deleteMapping.produces(), operationContext);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/GetMappingMethodAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\n\npublic class GetMappingMethodAnnotationProcessor extends AbstractHttpMethodMappingAnnotationProcessor<GetMapping, OperationContext> {\n\n  @Override\n  public void process(GetMapping getMapping, OperationContext operationContext) {\n    processPath(getMapping.path(), operationContext);\n    this.processPath(getMapping.path(), operationContext);\n    this.processPath(getMapping.value(), operationContext);\n    this.processMethod(RequestMethod.GET, operationContext);\n    this.processConsumes(getMapping.consumes(), operationContext);\n    this.processProduces(getMapping.produces(), operationContext);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/PathVariableAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\nimport org.apache.servicecomb.toolkit.generator.util.ParamUtils;\nimport org.springframework.web.bind.annotation.PathVariable;\n\npublic class PathVariableAnnotationProcessor implements ParamAnnotationProcessor<PathVariable, ParameterContext> {\n  @Override\n  public void process(PathVariable pathVariable, ParameterContext parameterContext) {\n    String paramName = pathVariable.name();\n    if (StringUtils.isEmpty(paramName)) {\n      paramName = ParamUtils\n          .getParameterName(parameterContext.getOperationContext().getMethod(), parameterContext.getParameter());\n    }\n\n    parameterContext.setIn(InType.PATH);\n    parameterContext.setName(paramName);\n    parameterContext.setRequired(pathVariable.required());\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/PostMappingMethodAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\n\npublic class PostMappingMethodAnnotationProcessor extends AbstractHttpMethodMappingAnnotationProcessor<PostMapping, OperationContext> {\n\n  @Override\n  public void process(PostMapping postMapping, OperationContext operationContext) {\n\n    this.processPath(postMapping.path(), operationContext);\n    this.processPath(postMapping.value(), operationContext);\n    this.processMethod(RequestMethod.POST, operationContext);\n    this.processConsumes(postMapping.consumes(), operationContext);\n    this.processProduces(postMapping.produces(), operationContext);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/PutMappingMethodAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.springframework.web.bind.annotation.PutMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\n\npublic class PutMappingMethodAnnotationProcessor extends AbstractHttpMethodMappingAnnotationProcessor<PutMapping, OperationContext> {\n\n  @Override\n  public void process(PutMapping putMapping, OperationContext operationContext) {\n\n    this.processPath(putMapping.path(), operationContext);\n    this.processPath(putMapping.value(), operationContext);\n    this.processMethod(RequestMethod.PUT, operationContext);\n    this.processConsumes(putMapping.consumes(), operationContext);\n    this.processProduces(putMapping.produces(), operationContext);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/RequestBodyAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\nimport org.springframework.web.bind.annotation.RequestBody;\n\npublic class RequestBodyAnnotationProcessor implements ParamAnnotationProcessor<RequestBody, ParameterContext> {\n\n  @Override\n  public void process(RequestBody requestBody, ParameterContext parameterContext) {\n    parameterContext.setIn(InType.BODY);\n    parameterContext.setRequired(requestBody.required());\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/RequestHeaderAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\nimport org.springframework.util.ObjectUtils;\nimport org.springframework.web.bind.annotation.RequestHeader;\nimport org.springframework.web.bind.annotation.ValueConstants;\n\npublic class RequestHeaderAnnotationProcessor implements ParamAnnotationProcessor<RequestHeader, ParameterContext> {\n\n  @Override\n  public void process(RequestHeader requestHeader, ParameterContext parameterContext) {\n    parameterContext.setIn(InType.HEADER);\n    parameterContext.setRequired(requestHeader.required());\n\n    if (!ObjectUtils.isEmpty(requestHeader.defaultValue()) && !ValueConstants.DEFAULT_NONE\n        .equals(requestHeader.defaultValue())) {\n      parameterContext.setDefaultValue(requestHeader.defaultValue());\n    }\n\n    String name = requestHeader.name();\n    if (StringUtils.isEmpty(name)) {\n      name = requestHeader.value();\n    }\n\n    parameterContext.setName(name);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/RequestMappingClassAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\n\npublic class RequestMappingClassAnnotationProcessor implements\n    ClassAnnotationProcessor<RequestMapping, OasContext> {\n\n  @Override\n  public void process(RequestMapping requestMapping, OasContext oasContext) {\n\n    String[] paths = requestMapping.value();\n    if (null == paths || paths.length == 0) {\n      return;\n    }\n\n    // swagger only support one basePath\n    if (paths.length > 1) {\n      throw new Error(\"not support multi path for \" + oasContext.getCls().getName());\n    }\n\n    oasContext.setBasePath(paths[0]);\n\n    processMethod(requestMapping.method(), oasContext);\n    processConsumes(requestMapping.consumes(), oasContext);\n    processProduces(requestMapping.produces(), oasContext);\n    processHeaders(requestMapping.headers(), oasContext);\n  }\n\n  protected void processMethod(RequestMethod[] requestMethods, OasContext oasContext) {\n    if (null == requestMethods || requestMethods.length == 0) {\n      return;\n    }\n\n    if (requestMethods.length > 1) {\n      throw new Error(\n          \"not allowed multi http method for \" + oasContext.getCls().getName());\n    }\n\n    oasContext.setHttpMethod(requestMethods[0].name());\n  }\n\n  protected void processConsumes(String[] consumes, OasContext oasContext) {\n    if (null == consumes || consumes.length == 0) {\n      return;\n    }\n    oasContext.setConsumers(consumes);\n  }\n\n  protected void processProduces(String[] produces, OasContext oasContext) {\n    if (null == produces || produces.length == 0) {\n      return;\n    }\n    oasContext.setProduces(produces);\n  }\n\n  protected void processHeaders(String[] headers, OasContext oasContext) {\n    if (null == headers || headers.length == 0) {\n      return;\n    }\n    oasContext.setHeaders(headers);\n  }\n}\n\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/RequestMappingMethodAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\n\npublic class RequestMappingMethodAnnotationProcessor extends\n    AbstractHttpMethodMappingAnnotationProcessor<RequestMapping, OperationContext> {\n\n  @Override\n  public void process(RequestMapping requestMapping, OperationContext operationContext) {\n\n    this.processPath(requestMapping.path(), operationContext);\n    this.processPath(requestMapping.value(), operationContext);\n    this.processMethod(requestMapping.method(), operationContext);\n    this.processConsumes(requestMapping.consumes(), operationContext);\n    this.processProduces(requestMapping.produces(), operationContext);\n    this.processHeaders(requestMapping.headers(), operationContext);\n  }\n\n  protected void processMethod(RequestMethod[] requestMethods, OperationContext operationContext) {\n    if (null == requestMethods || requestMethods.length == 0) {\n      return;\n    }\n\n    if (requestMethods.length > 1) {\n      throw new Error(\n          \"not allowed multi http method for \" + operationContext.getMethod().getName());\n    }\n\n    this.processMethod(requestMethods[0], operationContext);\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/RequestParamAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\nimport org.springframework.util.ObjectUtils;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.ValueConstants;\n\npublic class RequestParamAnnotationProcessor implements ParamAnnotationProcessor<RequestParam, ParameterContext> {\n\n  @Override\n  public void process(RequestParam requestParam, ParameterContext parameterContext) {\n\n    parameterContext.setIn(InType.QUERY);\n    String name = requestParam.value();\n    if (StringUtils.isEmpty(name)) {\n      name = requestParam.name();\n    }\n\n    parameterContext.setName(name);\n    parameterContext.setRequired(requestParam.required());\n    if (!ObjectUtils.isEmpty(requestParam.defaultValue()) && !ValueConstants.DEFAULT_NONE\n        .equals(requestParam.defaultValue())) {\n      parameterContext.setDefaultValue(requestParam.defaultValue());\n      parameterContext.setRequired(false);\n    }\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/annotation/RequestPartAnnotationProcessor.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.annotation;\n\nimport org.apache.servicecomb.toolkit.generator.MediaTypes;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext.InType;\nimport org.springframework.web.bind.annotation.RequestPart;\n\npublic class RequestPartAnnotationProcessor implements ParamAnnotationProcessor<RequestPart, ParameterContext> {\n  @Override\n  public void process(RequestPart requestPart, ParameterContext parameterContext) {\n    parameterContext.setIn(InType.BODY);\n    parameterContext.addConsume(MediaTypes.MULTIPART_FORM_DATA);\n    parameterContext.setRequired(requestPart.required());\n    parameterContext.setName(requestPart.name());\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/java/org/apache/servicecomb/toolkit/generator/parser/SpringmvcAnnotationParser.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator.parser;\n\nimport java.util.ArrayList;\nimport java.util.Comparator;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.generator.annotation.GetMappingMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.PathVariableAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.PostMappingMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.PutMappingMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestBodyAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestHeaderAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestMappingClassAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestMappingMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestPartAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.PutMapping;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestHeader;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.RequestPart;\nimport org.springframework.web.bind.annotation.RestController;\n\npublic class SpringmvcAnnotationParser extends AbstractAnnotationParser {\n\n  @Override\n  public int getOrder() {\n    return 200;\n  }\n\n  @Override\n  public void parser(Class<?> cls, OasContext context) {\n    super.parser(cls, context);\n  }\n\n  @Override\n  public boolean canProcess(Class<?> cls) {\n    if (cls.getAnnotation(RestController.class) != null) {\n      return true;\n    }\n    return false;\n  }\n\n  @Override\n  public void initClassAnnotationProcessor() {\n    super.initClassAnnotationProcessor();\n    classAnnotationMap.put(RequestMapping.class, new RequestMappingClassAnnotationProcessor());\n  }\n\n  @Override\n  public void initMethodAnnotationProcessor() {\n    super.initMethodAnnotationProcessor();\n    methodAnnotationMap.put(RequestMapping.class, new RequestMappingMethodAnnotationProcessor());\n    methodAnnotationMap.put(GetMapping.class, new GetMappingMethodAnnotationProcessor());\n    methodAnnotationMap.put(PutMapping.class, new PutMappingMethodAnnotationProcessor());\n    methodAnnotationMap.put(PostMapping.class, new PostMappingMethodAnnotationProcessor());\n  }\n\n  @Override\n  public void initParameterAnnotationProcessor() {\n    super.initParameterAnnotationProcessor();\n    parameterAnnotationMap.put(PathVariable.class, new PathVariableAnnotationProcessor());\n    parameterAnnotationMap.put(RequestBody.class, new RequestBodyAnnotationProcessor());\n    parameterAnnotationMap.put(RequestPart.class, new RequestPartAnnotationProcessor());\n    parameterAnnotationMap.put(RequestParam.class, new RequestParamAnnotationProcessor());\n    parameterAnnotationMap.put(RequestHeader.class, new RequestHeaderAnnotationProcessor());\n  }\n}\n\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/resources/META-INF/services/org.apache.servicecomb.toolkit.generator.annotation.ModelInterceptor",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\norg.apache.servicecomb.toolkit.generator.MultipartFileInterceptor"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/main/resources/META-INF/services/org.apache.servicecomb.toolkit.generator.parser.api.OpenApiAnnotationParser",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\norg.apache.servicecomb.toolkit.generator.parser.SpringmvcAnnotationParser"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/test/java/org/apache/servicecomb/toolkit/generator/SpringAnnotationProcessorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator;\n\nimport java.lang.reflect.Method;\nimport java.lang.reflect.Parameter;\n\nimport org.apache.servicecomb.toolkit.generator.annotation.DeleteMappingMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.GetMappingMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.PathVariableAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.PostMappingMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.PutMappingMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestBodyAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestHeaderAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestMappingClassAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestMappingMethodAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestParamAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.annotation.RequestPartAnnotationProcessor;\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\nimport org.apache.servicecomb.toolkit.generator.context.OperationContext;\nimport org.apache.servicecomb.toolkit.generator.context.ParameterContext;\nimport org.apache.servicecomb.toolkit.generator.parser.SpringmvcAnnotationParser;\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.springframework.web.bind.annotation.DeleteMapping;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.PutMapping;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestHeader;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.RequestPart;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport io.swagger.v3.oas.models.media.FileSchema;\n\npublic class SpringAnnotationProcessorTest {\n\n  @Test\n  public void methodOfRequestMapping() throws NoSuchMethodException {\n\n    // class level\n    SpringmvcAnnotationParser parser = new SpringmvcAnnotationParser();\n    OasContext oasContext = new OasContext(parser);\n    Class<HttpMethodResource> httpMethodResourceClass = HttpMethodResource.class;\n    RequestMapping requestMappingClassAnnotation = httpMethodResourceClass.getAnnotation(RequestMapping.class);\n    RequestMappingClassAnnotationProcessor requestMappingClassAnnotationProcessor = new RequestMappingClassAnnotationProcessor();\n    requestMappingClassAnnotationProcessor.process(requestMappingClassAnnotation, oasContext);\n    Assert.assertEquals(RequestMethod.GET.name(), oasContext.getHttpMethod());\n\n    // method level\n    RequestMappingMethodAnnotationProcessor requestMappingMethodAnnotationProcessor = new RequestMappingMethodAnnotationProcessor();\n    Method requestMethod = httpMethodResourceClass.getMethod(\"request\");\n    RequestMapping requestMappingMethodAnnotation = requestMethod.getAnnotation(RequestMapping.class);\n    OperationContext requestOperationContext = new OperationContext(requestMethod, oasContext);\n    requestMappingMethodAnnotationProcessor.process(requestMappingMethodAnnotation, requestOperationContext);\n    Assert.assertEquals(RequestMethod.POST.name(), requestOperationContext.getHttpMethod());\n\n    // default\n    Method getRequestMethod = httpMethodResourceClass.getMethod(\"getRequest\");\n    RequestMapping getRequestMappingMethodAnnotation = getRequestMethod.getAnnotation(RequestMapping.class);\n    OperationContext getRequestOperationContext = new OperationContext(getRequestMethod, oasContext);\n    requestMappingMethodAnnotationProcessor.process(getRequestMappingMethodAnnotation, getRequestOperationContext);\n    Assert.assertEquals(RequestMethod.GET.name(), getRequestOperationContext.getHttpMethod());\n  }\n\n  @Test\n  public void pathOfRequestMapping() {\n    SpringmvcAnnotationParser parser = new SpringmvcAnnotationParser();\n    OasContext oasContext = new OasContext(parser);\n    Class<HttpMethodResource> httpMethodResourceClass = HttpMethodResource.class;\n    RequestMapping requestMappingClassAnnotation = httpMethodResourceClass.getAnnotation(RequestMapping.class);\n    RequestMappingClassAnnotationProcessor requestMappingClassAnnotationProcessor = new RequestMappingClassAnnotationProcessor();\n    requestMappingClassAnnotationProcessor.process(requestMappingClassAnnotation, oasContext);\n    Assert.assertEquals(requestMappingClassAnnotation.value()[0], oasContext.getBasePath());\n  }\n\n  @Test\n  public void headersOfRequestMapping() throws NoSuchMethodException {\n    SpringmvcAnnotationParser parser = new SpringmvcAnnotationParser();\n    OasContext oasContext = new OasContext(parser);\n    Class<HttpMethodResource> httpMethodResourceClass = HttpMethodResource.class;\n    RequestMappingMethodAnnotationProcessor requestMappingMethodAnnotationProcessor = new RequestMappingMethodAnnotationProcessor();\n    Method requestMethod = httpMethodResourceClass.getMethod(\"request\");\n    RequestMapping requestMappingMethodAnnotation = requestMethod.getAnnotation(RequestMapping.class);\n    OperationContext requestOperationContext = new OperationContext(requestMethod, oasContext);\n    requestMappingMethodAnnotationProcessor.process(requestMappingMethodAnnotation, requestOperationContext);\n    Assert.assertArrayEquals(requestMappingMethodAnnotation.headers(), requestOperationContext.getHeaders());\n  }\n\n  @Test\n  public void consumesOfRequestMapping() throws NoSuchMethodException {\n    SpringmvcAnnotationParser parser = new SpringmvcAnnotationParser();\n    OasContext oasContext = new OasContext(parser);\n    Class<HttpMethodResource> httpMethodResourceClass = HttpMethodResource.class;\n    RequestMappingMethodAnnotationProcessor requestMappingMethodAnnotationProcessor = new RequestMappingMethodAnnotationProcessor();\n    Method requestMethod = httpMethodResourceClass.getMethod(\"request\");\n    RequestMapping requestMappingMethodAnnotation = requestMethod.getAnnotation(RequestMapping.class);\n    OperationContext requestOperationContext = new OperationContext(requestMethod, oasContext);\n    requestMappingMethodAnnotationProcessor.process(requestMappingMethodAnnotation, requestOperationContext);\n    Assert.assertArrayEquals(requestMappingMethodAnnotation.consumes(), requestOperationContext.getConsumers());\n  }\n\n  @Test\n  public void producesOfRequestMapping() throws NoSuchMethodException {\n    SpringmvcAnnotationParser parser = new SpringmvcAnnotationParser();\n    OasContext oasContext = new OasContext(parser);\n    Class<HttpMethodResource> httpMethodResourceClass = HttpMethodResource.class;\n    RequestMappingMethodAnnotationProcessor requestMappingMethodAnnotationProcessor = new RequestMappingMethodAnnotationProcessor();\n    Method requestMethod = httpMethodResourceClass.getMethod(\"request\");\n    RequestMapping requestMappingMethodAnnotation = requestMethod.getAnnotation(RequestMapping.class);\n    OperationContext requestOperationContext = new OperationContext(requestMethod, oasContext);\n    requestMappingMethodAnnotationProcessor.process(requestMappingMethodAnnotation, requestOperationContext);\n    Assert.assertArrayEquals(requestMappingMethodAnnotation.produces(), requestOperationContext.getProduces());\n  }\n\n\n  @Test\n  public void methodOfGetMapping() throws NoSuchMethodException {\n\n    SpringmvcAnnotationParser parser = new SpringmvcAnnotationParser();\n    OasContext oasContext = new OasContext(parser);\n    Class<HttpMethodResource> httpMethodResourceClass = HttpMethodResource.class;\n\n    GetMappingMethodAnnotationProcessor getMappingMethodAnnotationProcessor = new GetMappingMethodAnnotationProcessor();\n    Method getMethod = httpMethodResourceClass.getMethod(\"get\");\n    GetMapping getMappingAnnotation = getMethod.getAnnotation(GetMapping.class);\n    OperationContext getOperationContext = new OperationContext(getMethod, oasContext);\n    getMappingMethodAnnotationProcessor.process(getMappingAnnotation, getOperationContext);\n    Assert\n        .assertEquals(getMappingAnnotation.value()[0], getOperationContext.getPath());\n  }\n\n  @Test\n  public void methodOfPostMapping() throws NoSuchMethodException {\n\n    SpringmvcAnnotationParser parser = new SpringmvcAnnotationParser();\n    OasContext oasContext = new OasContext(parser);\n    Class<HttpMethodResource> httpMethodResourceClass = HttpMethodResource.class;\n\n    PostMappingMethodAnnotationProcessor postMappingMethodAnnotationProcessor = new PostMappingMethodAnnotationProcessor();\n    Method postMethod = httpMethodResourceClass.getMethod(\"post\");\n    PostMapping postMappingAnnotation = postMethod.getAnnotation(PostMapping.class);\n    OperationContext postOperationContext = new OperationContext(postMethod, oasContext);\n    postMappingMethodAnnotationProcessor.process(postMappingAnnotation, postOperationContext);\n    Assert\n        .assertEquals(postMappingAnnotation.value()[0], postOperationContext.getPath());\n  }\n\n  @Test\n  public void methodOfPutMapping() throws NoSuchMethodException {\n\n    SpringmvcAnnotationParser parser = new SpringmvcAnnotationParser();\n    OasContext oasContext = new OasContext(parser);\n    Class<HttpMethodResource> httpMethodResourceClass = HttpMethodResource.class;\n\n    PutMappingMethodAnnotationProcessor putMappingMethodAnnotationProcessor = new PutMappingMethodAnnotationProcessor();\n    Method putMethod = httpMethodResourceClass.getMethod(\"put\");\n    PutMapping putMappingAnnotation = putMethod.getAnnotation(PutMapping.class);\n    OperationContext putOperationContext = new OperationContext(putMethod, oasContext);\n    putMappingMethodAnnotationProcessor.process(putMappingAnnotation, putOperationContext);\n    Assert\n        .assertEquals(putMappingAnnotation.value()[0], putOperationContext.getPath());\n  }\n\n  @Test\n  public void methodOfDeleteMapping() throws NoSuchMethodException {\n    SpringmvcAnnotationParser parser = new SpringmvcAnnotationParser();\n    OasContext oasContext = new OasContext(parser);\n    Class<HttpMethodResource> httpMethodResourceClass = HttpMethodResource.class;\n\n    DeleteMappingMethodAnnotationProcessor deleteMappingMethodAnnotationProcessor = new DeleteMappingMethodAnnotationProcessor();\n    Method deleteMethod = httpMethodResourceClass.getMethod(\"delete\");\n    DeleteMapping delelteMappingAnnotation = deleteMethod.getAnnotation(DeleteMapping.class);\n    OperationContext deleteOperationContext = new OperationContext(deleteMethod, oasContext);\n    deleteMappingMethodAnnotationProcessor.process(delelteMappingAnnotation, deleteOperationContext);\n    Assert\n        .assertEquals(delelteMappingAnnotation.value()[0], deleteOperationContext.getPath());\n  }\n\n  @Test\n  public void parseParameter() throws NoSuchMethodException {\n    Class<ParamAnnotationResource> paramAnnotationResourceClass = ParamAnnotationResource.class;\n    OasContext oasContext = new OasContext(null);\n    OperationContext operationContext;\n    ParameterContext parameterContext;\n\n    RequestParamAnnotationProcessor requestParamAnnotationProcessor = new RequestParamAnnotationProcessor();\n    Method requestParamMethod = paramAnnotationResourceClass.getMethod(\"requestParam\", String.class);\n    Parameter requestParamMethodParam = requestParamMethod.getParameters()[0];\n    RequestParam requestParamAnnotation = requestParamMethodParam\n        .getAnnotation(RequestParam.class);\n    operationContext = new OperationContext(requestParamMethod, oasContext);\n    parameterContext = new ParameterContext(operationContext, requestParamMethodParam);\n    requestParamAnnotationProcessor.process(requestParamAnnotation, parameterContext);\n    io.swagger.v3.oas.models.parameters.Parameter oasParameter = parameterContext.toParameter();\n    Assert.assertNull(parameterContext.getDefaultValue());\n    Assert.assertNull(oasParameter.getSchema().getDefault());\n\n    PathVariableAnnotationProcessor pathVariableAnnotationProcessor = new PathVariableAnnotationProcessor();\n    Method pathVariableMethod = paramAnnotationResourceClass.getMethod(\"pathVariable\", String.class);\n    Parameter pathVariableMethodParam = pathVariableMethod.getParameters()[0];\n    PathVariable pathVariableAnnotation = pathVariableMethodParam\n        .getAnnotation(PathVariable.class);\n    operationContext = new OperationContext(pathVariableMethod, oasContext);\n    parameterContext = new ParameterContext(operationContext, pathVariableMethodParam);\n    pathVariableAnnotationProcessor.process(pathVariableAnnotation, parameterContext);\n    parameterContext.toParameter();\n    Assert.assertTrue(parameterContext.isRequired());\n\n    RequestPartAnnotationProcessor requestPartAnnotationProcessor = new RequestPartAnnotationProcessor();\n    Method requestPartMethod = paramAnnotationResourceClass.getMethod(\"requestPart\", MultipartFile.class);\n    Parameter requestPartMethodParam = requestPartMethod.getParameters()[0];\n    RequestPart requestPartParamAnnotation = requestPartMethodParam\n        .getAnnotation(RequestPart.class);\n    operationContext = new OperationContext(requestPartMethod, oasContext);\n    parameterContext = new ParameterContext(operationContext, requestPartMethodParam);\n    requestPartAnnotationProcessor.process(requestPartParamAnnotation, parameterContext);\n    oasParameter = parameterContext.toParameter();\n    Assert.assertNull(parameterContext.getDefaultValue());\n    Assert.assertEquals(FileSchema.class, oasParameter.getSchema().getClass());\n\n    RequestHeaderAnnotationProcessor requestHeaderAnnotationProcessor = new RequestHeaderAnnotationProcessor();\n    Method requestHeaderMethod = paramAnnotationResourceClass.getMethod(\"requestHeader\", String.class);\n    Parameter requestHeaderMethodParam = requestHeaderMethod.getParameters()[0];\n    RequestHeader requestHeaderParamAnnotation = requestHeaderMethodParam\n        .getAnnotation(RequestHeader.class);\n    operationContext = new OperationContext(requestPartMethod, oasContext);\n    parameterContext = new ParameterContext(operationContext, requestHeaderMethodParam);\n    requestHeaderAnnotationProcessor.process(requestHeaderParamAnnotation, parameterContext);\n    oasParameter = parameterContext.toParameter();\n    Assert.assertNull(parameterContext.getDefaultValue());\n    Assert.assertNull(oasParameter.getSchema().getDefault());\n\n    RequestBodyAnnotationProcessor requestBodyAnnotationProcessor = new RequestBodyAnnotationProcessor();\n    Method requestBodyMethod = paramAnnotationResourceClass.getMethod(\"requestBody\", String.class);\n    Parameter requestBodyMethodParam = requestBodyMethod.getParameters()[0];\n    RequestBody requestBodyParamAnnotation = requestBodyMethodParam\n        .getAnnotation(RequestBody.class);\n    operationContext = new OperationContext(requestBodyMethod, oasContext);\n    parameterContext = new ParameterContext(operationContext, requestBodyMethodParam);\n    requestBodyAnnotationProcessor.process(requestBodyParamAnnotation, parameterContext);\n    parameterContext.toParameter();\n    Assert.assertTrue(parameterContext.isRequired());\n  }\n\n  @Test\n  public void interceptorModel() {\n    MultipartFileInterceptor interceptor = new MultipartFileInterceptor();\n    Assert.assertEquals(100, interceptor.order());\n  }\n\n  @RestController\n  @RequestMapping(value = \"/path\", method = RequestMethod.GET)\n  class HttpMethodResource {\n\n    @RequestMapping(value = \"/request\", method = RequestMethod.POST, headers = \"cookie=1\", consumes = \"application/json\", produces = \"application/json\")\n    public String request() {\n      return \"request\";\n    }\n\n    @RequestMapping(value = \"/getRequest\")\n    public String getRequest() {\n      return \"getRequest\";\n    }\n\n    @GetMapping(value = \"/get\", consumes = {\"application/json\"}, produces = {\"application/json\"})\n    public String get() {\n      return \"get\";\n    }\n\n    @PostMapping(\"/post\")\n    public String post() {\n      return \"post\";\n    }\n\n    @PutMapping(\"/put\")\n    public String put() {\n      return \"put\";\n    }\n\n    @DeleteMapping(\"/delete\")\n    public String delete() {\n      return \"delete\";\n    }\n  }\n\n\n  class ParamAnnotationResource {\n\n    public void requestParam(@RequestParam(\"param\") String param) {\n    }\n\n    public void requestBody(@RequestBody String param) {\n    }\n\n    public void requestHeader(@RequestHeader String headerParam) {\n    }\n\n    public void requestPart(@RequestPart MultipartFile file) {\n    }\n\n    public void pathVariable(@PathVariable String path) {\n    }\n  }\n}\n"
  },
  {
    "path": "oas-generator/oas-generator-spring/src/test/java/org/apache/servicecomb/toolkit/generator/SpringParserTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.generator;\n\nimport org.apache.servicecomb.toolkit.generator.context.OasContext;\nimport org.apache.servicecomb.toolkit.generator.parser.SpringmvcAnnotationParser;\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.springframework.web.bind.annotation.RestController;\n\npublic class SpringParserTest {\n\n  @Test\n  public void parse() {\n    SpringmvcAnnotationParser parser = new SpringmvcAnnotationParser();\n\n    Assert.assertEquals(200, parser.getOrder());\n    boolean canProcess = parser.canProcess(String.class);\n    Assert.assertFalse(canProcess);\n\n    canProcess = parser.canProcess(SpringmvcController.class);\n    Assert.assertTrue(canProcess);\n\n    OasContext oasContext = new OasContext(parser);\n    parser.parser(SpringmvcController.class, oasContext);\n  }\n\n  @RestController\n  class SpringmvcController {\n\n  }\n}\n"
  },
  {
    "path": "oas-generator/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>toolkit</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n  <packaging>pom</packaging>\n  <modules>\n    <module>oas-generator-core</module>\n    <module>oas-generator-jaxrs</module>\n    <module>oas-generator-spring</module>\n    <module>oas-generator-servicecomb</module>\n  </modules>\n\n  <artifactId>oas-generator</artifactId>\n</project>"
  },
  {
    "path": "oas-validator/.gitignore",
    "content": "HELP.md\n/target/\n!.mvn/wrapper/maven-wrapper.jar\n\n### STS ###\n.apt_generated\n.classpath\n.factorypath\n.project\n.settings\n.springBeans\n.sts4-cache\n\n### IntelliJ IDEA ###\n.idea\n*.iws\n*.iml\n*.ipr\n\n### NetBeans ###\n/nbproject/private/\n/nbbuild/\n/dist/\n/nbdist/\n/.nb-gradle/\n/build/\n\n### VS Code ###\n.vscode/\n\n*/target\n*.class"
  },
  {
    "path": "oas-validator/README-ZH.md",
    "content": "# OAS Validator | [English](./README.md)\n\nOpenAPI V3 Spec校验工具。\n\n## 项目结构\n\n* oas-validator-core，核心API及骨架实现\n* oas-validator-core-spring，骨架的Spring Boot Starter\n* oas-validator-test，核心API的测试帮助类\n* oas-validator-style，风格校验实现\n* oas-validator-compatibility，兼容性校验实现\n* oas-validator-compatibility-spring，兼容性校验实现的Spring Boot Starter\n* oas-validator-web，校验工具的操作UI\n\n## 风格校验\n\nOAS必须符合[OAS 3.0.2规范][openapi-3.0.2]（比如属性的名称、REQUIED要求）。除此之外则是我们自己的定义的风格检查。\n\n### 一些字符串匹配规则\n\n* <a name=\"lower-camel-case\"></a>lower-camel-case：首字母小写的驼峰，对应的正则`^[a-z]+((\\d)|([A-Z0-9][a-z0-9]+))*([A-Z])?$`\n* <a name=\"upper-camel-case\"></a>upper-camel-case：首字母大写的驼峰，对应的正则`^[A-Z]([a-z0-9]+[A-Z]?)*$`\n* <a name=\"upper-hyphen-case\"></a>upper-hyphen-case：单词首字母大写，多个单词用`-`连接，比如`Content-Type`、`Accept`、`X-Rate-Limit-Limit`。对应的正则：`^([A-Z][a-z0-9]*-)*([A-Z][a-z0-9]*)$`\n\n### 配置校验规则\n\n下面是配置文件的例子`style-check-rule.properties`：\n\n```properties\n#######################\n# OpenAPI Object\n#######################\n# openapi property must be 3.0.x and >= 3.0.2\nopenAPI.openapi.gte=3.0.2\n# tags property size should >= 1\nopenAPI.tags.size.gte=1\n# security property size must == 0\nopenAPI.security.size.eq=0\n\n#######################\n# Info Object\n#######################\n# description property is required\ninfo.description.required=true\n\n#######################\n# Tag Object\n#######################\n# name property, must be upper-camel-case\ntag.name.case=upper-camel-case\n# tag should be referenced by at least one Operation Object\ntag.name.must_be_referenced=true\n# description property, required\ntag.description.required=true\n\n#######################\n# Paths Object\n#######################\n# path must be lower-camel-case, including Path Templating variable\npaths.key.case=lower-camel-case\n\n#######################\n# Operation Object\n#######################\n# summary property, required\noperation.summary.required=true\n# operationId property, must be lower-camel-case\noperation.operationId.case=lower-camel-case\n# tags property, size must == 1\noperation.tags.size.eq=1\n# all tags should references which are defined in $.tags\noperation.tags.element.must_reference_root_tags=true\n# servers property, size must == 0\noperations.servers.size.eq=0\n\n#######################\n# Parameter Object\n#######################\n# description property, required\nparameter.description.required=true\n# name property, for header parameter, must be upper-hyphen-case\nparameter.name.header.case=upper-hyphen-case\n# name property, for cookie parameter, must be lower-camel-case\nparameter.name.cookie.case=lower-camel-case\n# name property, for path parameter, must be lower-camel-case\nparameter.name.path.case=lower-camel-case\n# name property, for query parameter, must be lower-camel-case\nparameter.name.query.case=lower-camel-case\n\n#######################\n# RequestBody Object\n#######################\n# description property, required\nrequestBody.description.required=true\n\n#######################\n# Response Object\n#######################\n# headers property's key must be upper-hyphen-case\nresponse.headers.key.case=upper-hyphen-case\n\n#######################\n# Schema Object\n#######################\n# title property, required if parent is Schema Object or Components Object\nschema.title.required=true\n# properties property, name(properties key) must be lower-camel-case\nschema.properties.key.case=lower-camel-case\n\n#######################\n# Encoding Object\n#######################\n# headers property's key must be upper-hyphen-case\nencoding.headers.key.case=upper-hyphen-case\n\n#######################\n# Header Object\n#######################\n# description property, required\nheader.description.required=true\n\n#######################\n# Components Object\n#######################\n# schemas property's key must be upper-camel-case\ncomponents.schemas.key.case=upper-camel-case\n# responses property's key must be upper-camel-case\ncomponents.responses.key.case=upper-camel-case\n# parameters property's key must be upper-camel-case\ncomponents.parameters.key.case=upper-camel-case\n# examples property's key must be upper-camel-case\ncomponents.examples.key.case=upper-camel-case\n# requestBodies property's key must be upper-camel-case\ncomponents.requestBodies.key.case=upper-camel-case\n# headers property's key must be upper-hyphen-case\ncomponents.headers.key.case=upper-hyphen-case\n# links property's key must be upper-camel-case\ncomponents.links.key.case=upper-hyphen-case\n# callbacks property's key must be upper-camel-case\ncomponents.callbacks.key.case=upper-camel-case\n# headers property's key must be upper-camel-case\ncomponents.headers.key.case=upper-camel-case\n```\n\n## 兼容性检查\n\n对新旧两个版本的OAS做兼容性检查。\n\nOAS可以使用[Reference Object][spec-reference]来描述Spec，两个不同的OAS会出现描述不同但语义相同的情况。比如下面的旧OAS没有使用[Reference Object][spec-reference]，而新OAS则使用了的情况：\n\n旧OAS\n\n```yaml\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: List all pets\n      operationId: listPets\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: array\n              items:\n                type: object\n                properties:\n                  Foo:\n                    type: string\n      responses:\n        '200':\n          description: A paged array of pets\n```\n\n新OAS\n\n```yaml\npaths:\n  /pets:\n    post:\n      operationId: listPets\n      requestBody:\n        content:\n          application/json: \n            schema:\n              $ref: '#/components/schemas/Foo'\n      responses:\n        '200':\n          description: A paged array of pets\ncomponents:\n  schemas:\n    Foo:\n      type: array\n      items:\n        type: object\n        properties:\n          Foo:\n            type: string\n```\n\n因此在检查兼容性的时候会将新旧OAS的[Reference Object][spec-reference]做解析，然后再检查，下面是一段[swagger-parser][swagger-parser]的例子：\n\n```java\nOpenAPIV3Parser parser = new OpenAPIV3Parser();\n\nParseOptions parseOptions = new ParseOptions();\nparseOptions.setResolve(true);\nparseOptions.setResolveCombinators(true);\nparseOptions.setResolveFully(true);\nparseOptions.setFlatten(false);\n\nSwaggerParseResult parseResult = parser.readContents(content, null, parseOptions);\n```\n\n因此，检查下来如果发现不兼容，那么所报告的位置会和原文档有所不同。\n\n### Paths Object [doc][spec-paths]\n\n<a name=\"paths-compatibility\"></a>\n\n* 新OAS必须包含旧OAS的所有的`path`，如果`path`使用了[Path Templating][spec-path-templating]，只要变量名发生了变化，那么即使语义上相同也会被认为不同，比如`/pets/{foo}`和`/pets/{bar}`会被认定为不同。\n  * 见[Path Item Object兼容性检查](#path-item-compatibility)\n\n### Path Item Object [doc][spec-path-item]\n\n<a name=\"path-item-compatibility\"></a>\n\n* 新OAS必须包含旧OAS的所有的get/put/post/delete/...[Operation Object][spec-operation]\n\n### Operation Object [doc][spec-operation]\n\n<a name=\"operation-compatibility\"></a>\n\n* `operationId`属性，新旧OAS必须完全一致。\n* `parameters`属性，对它检查须在考虑到[Path Item Object parameters属性][spec-path-item-parameters]的情况下进行：\n  * 新OAS可以新增[Parameter Object][spec-parameter]，但是新增的[Parameter Object][spec-parameter]的`required`属性必须为`false`\n  * 新OAS可以删除[Parameter Object][spec-parameter]\n  * 针对单个[Parameter Object][spec-parameter]的修改的检查见[Parameter Object兼容性检查](#parameter-compatibility)（在同一个[Operation Object][spec-operation]下[Parameter Object][spec-parameter]依靠`name`和`in`两个属性作为ID）。\n* `requestBody`属性，见[Request Body Object兼容性检查](#request-body-compatibility)\n* `responses`属性，见[Responses Object兼容性检查](#responses-compatibility)\n\n### Parameter Object [doc][spec-parameter]\n\n<a name=\"parameter-compatibility\"></a>\n\n* `required`属性，只允许`true(旧) -> false(新)`\n* `allowEmptyValue`属性，只允许`false(旧) -> true(新)`的变化\n* `style`属性，新旧OAS必须保持一致\n* `explode`属性，新旧OAS必须保持一致\n* `allowReserved`属性，只允许`false(旧) -> true(新)`的变化\n* `schema`属性，见[Schema Object兼容性检查](#schema-compatibility)\n* `content`属性，新OAS必须包含旧OAS的所有media type（`content`的key），且不能新增media type\n  * 见[Media Type Object兼容性检查](#media-type-compatibility)\n\n### Request Body Object [doc][spec-request-body]\n\n<a name=\"request-body-compatibility\"></a>\n\n* `content`属性，新OAS必须包含旧OAS的所有media type（`content`的key）\n  * 见[Media Type Object兼容性检查](#media-type-compatibility)\n* `required`属性，只允许`true(旧) -> false(新)`的变化\n\n### Media Type Object [doc][spec-media-type]\n\n<a name=\"media-type-compatibility\"></a>\n\n* `schema`属性，见[Schema Object兼容性检查](#schema-compatibility)\n* `encoding`属性，该属性仅适用于`requestBody`，因此新旧OAS的property name（`encoding`的key）必须完全一致\n  * 见[Encoding Object兼容性检查](#encoding-compatibility)\n\n### Responses Object [doc][spec-responses]\n\n<a name=\"responses-compatibility\"></a>\n\n* `default`属性，如果旧OAS没有定义`default`，那么新OAS也不能定义`default`。\n* `{Http Status Code}`属性，新OAS不允许新增。\n* 见[Response Object兼容性检查](#response-compatibility)\n\n### Response Object [doc][spec-response]\n\n<a name=\"response-compatibility\"></a>\n\n* `headers`属性，新OAS必须包含旧OAS的所有header name（`headers`的key），可以新增header name\n  * [Header Object][spec-header]见[Header Object兼容性检查](#header-compatibility)\n* `content`属性，新OAS必须包含旧OAS的所有media type（`content`的key），可以新增media type\n  - [Media Type Object][spec-media-type]见[Media Type Object兼容性检查](#media-type-compatibility)\n\n### Schema Object [doc][spec-schema]\n\n<a name=\"schema-compatibility\"></a>\n\nOAS中定义，Schema Object可以直接或间接用在：\n\n* 请求类：[Parameter Object][spec-parameter]、[Request Body Object][spec-request-body]、[Header Object][spec-header]\n* 响应类：[Header Object][spec-header]、[Response Object][spec-response]\n\n不同用途的兼容性检查规则有所不同。\n\n### 用做请求时\n\n原则上，当Schema Object用在请求时，只允许从紧到松的变化。\n\n* `type, format`组合所允许的变化范围\n\n| 旧(type,format)  | 新(type,format)                                              |\n| ---------------- | ------------------------------------------------------------ |\n| integer, null    | integer, int64<br />number, double<br />number, null         |\n| integer, int32   | integer, int64<br />integer, null<br />number, float<br />number, double<br />number, null |\n| integer, int64   | integer, null<br />number, double<br />number, null          |\n| number, null     | number, double                                               |\n| number, float    | number, null<br />number, double                             |\n| number, double   | number, null                                                 |\n| string, null     | string, password                                             |\n| string, password | string, null                                                 |\n\n* `allOf`、`oneOf`、`anyOf`属性，在combine之后再做检查\n* `multipleOf`属性，如果旧OAS为null。新OAS必须==旧OAS或者新OAS是旧OAS的因子，比如6(旧)->3(新)\n* `maximum`、`maxLength`、`maxItems`、`maxProperties`，如果旧OAS为null，那么新OAS也必须是null。其他情况，新OAS必须>=旧OAS。\n* `minimum`、`minLenght`、`minItems`、`minProperties`，如果旧OAS为null，那么新OAS也必须是null。其他情况，新OAS必须<=旧OAS。\n* `exclusiveMaximum`、`exclusiveMinimum`属性，仅允许`true(旧)->false(新)`的变化\n* `uniqueItems`属性，只允许`true(旧)->false(新)`的变化。\n* `required`属性，新OAS必须==旧OAS，或者新OAS是旧OAS的子集。\n* `enum`属性，新OAS必须==旧OAS，或者新OAS是旧OAS的超集。\n* `properties`属性，新OAS可以新增property name（`properties`的key）或者减少property name。\n* `nullable`属性，只允许`false(旧)->true(新)`的变化。\n* `discriminator`属性，新旧OAS必须完全一致。\n* `xml`属性，新旧OAS必须完全一致。\n* `readOnly`、`writeOnly`，新旧OAS必须完全一致。\n\n### 用做响应时\n\n原则上，当Schema Object用在响应时，只允许从松到紧的变化。\n\n* `type, format`组合所允许的变化范围\n\n| 旧(type,format)  | 新(type,format)                    |\n| ---------------- | ---------------------------------- |\n| integer, null    | integer, int64<br />integer, int32 |\n| integer, int64   | integer, null<br />interger, int32 |\n| number, null     | number, double<br />number, float  |\n| number, double   | number, null<br />number, float    |\n| string, null     | string, password                   |\n| string, password | string, null                       |\n\n* `allOf`、`oneOf`、`anyOf`属性，在combine之后再做检查\n* `multipleOf`属性，如果旧OAS为null。新OAS必须==旧OAS或者新OAS是旧OAS的倍数，比如3(旧)->6(新)\n* `maximum`、`maxLength`、`maxItems`、`maxProperties`，如果旧OAS为null，那么新OAS也必须是null。其他情况，新OAS必须<=旧OAS。\n* `minimum`、`minLenght`、`minItems`、`minProperties`，如果旧OAS为null，那么新OAS也必须是null。其他情况，新OAS必须>=旧OAS。\n* `exclusiveMaximum`、`exclusiveMinimum`属性，仅允许`false(旧)->true(新)`的变化\n* `uniqueItems`属性，只允许`false(旧)->true(新)`的变化。\n* `required`属性，新OAS必须==旧OAS或者，新OAS是旧OAS的超集。\n* `enum`属性，新OAS必须==旧OAS，或者新OAS是旧OAS的子集。\n* `properties`属性，新OAS可以新增property name（`properties`的key）或者减少property name。\n* `nullable`属性，只允许`true(旧)->false(新)`的变化。\n* `discriminator`属性，新旧OAS必须完全一致。\n* `xml`属性，新旧OAS必须完全一致。\n* `readOnly`、`writeOnly`，新旧OAS必须完全一致。\n\n### Encoding Object [doc][spec-encoding]\n\n<a name=\"encoding-compatibility\"></a>\n\nPS. Encoding Object仅针对Request Body Object有用\n\n* `contentType`属性，新旧OAS必须保持一致\n* `headers`属性，新OAS不能新增旧OAS的header name（`headers`的key），但是可以删除header name\n  * [Header Object][spec-header]见[Header Object兼容性检查](#header-compatibility)\n* `style`属性，新旧OAS必须保持一致\n* `explode`属性，新旧OAS必须保持一致\n* `allowReserved`属性，只允许`false(旧) -> true(新)`的变化\n\n### Header Object [doc][spec-header]\n\n<a name=\"header-compatibility\"></a>\n\n- `schema`属性，见[Schema Object兼容性检查](#schema-compatibility)\n\n### Components Object [doc][spec-components]\n\n<a name=\"components-compatibility\"></a>\n\n[Components Object][spec-components]定义的都是可复用OAS Object，而在检查兼容性的时候所有`$ref`都已被解析了，因此不需要对[Components Object][spec-components]的属性做兼容性检查。\n\n\n[spec-operation]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\n[openapi-3.0.2]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md\n[spec-openapi]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#openapi-object\n[spec-server]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#serverObject\n[spec-info]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#infoObject\n[spec-paths]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#paths-object\n[spec-path-item]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathItemObject\n[spec-parameter]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject\n[spec-request-body]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#requestBodyObject\n[spec-security-scheme]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#securitySchemeObject\n[spec-components]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#components-object\n[spec-tag]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#tagObject\n[spec-schema]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject\n\n[spec-media-type]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#media-type-object\n[spec-response]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#response-object\n[spec-path-templating]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#path-templating\n[spec-parameterIn]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterIn\n[spec-encoding]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#encodingObject\n[spec-header]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#header-object\n[spec-info]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#infoObject\n[spec-reference]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#reference-object\n[swagger-parser]: https://github.com/swagger-api/swagger-parser\n[spec-path-item-parameters]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-pathitemparameters\n[spec-responses]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responsesObject\n"
  },
  {
    "path": "oas-validator/README.md",
    "content": "# OAS Validator | [中文](./README-ZH.md)\n\nOpenAPI V3 Spec validation tools.\n\n## Project structure\n\n* oas-validator-core: core apis and skeletons implementations\n* oas-validator-core-spring: Spring Boot Starter for core skeletons\n* oas-validator-test: test helpers for core api\n* oas-validator-style: check style validators\n* oas-validator-compatibility: compatibility validators\n* oas-validator-compatibility-spring: Spring Boot Starter for compatibility validators\n* oas-validator-web: web ui\n\n## Style checking\n\nOAS must compatible with [OAS 3.0.2][openapi-3.0.2], besides must obey the following rules. \n\n### String patterns\n\n* <a name=\"lower-camel-case\"></a> lower-camel-case: initial letter lowercase camel case, regex is `^[a-z]+((\\d)|([A-Z0-9][a-z0-9]+))*([A-Z])?$`\n* <a name=\"upper-camel-case\"></a> upper-camel-case: initial letter uppercase camel case, regex is `^[A-Z]([a-z0-9]+[A-Z]?)*$`\n* <a name=\"upper-hyphen-case\"></a> upper-hyphen-case: initial letter uppercase, multiple words concat with `-`, such as `Content-Type`, `Accept`, `X-Rate-Limit-Limit`, regex is `^([A-Z][a-z0-9]*-)*([A-Z][a-z0-9]*)$`\n\n### Rules properties file\n\nBelow is a  `style-check-rule.properties` example:\n\n```properties\n#######################\n# OpenAPI Object\n#######################\n# openapi property must be 3.0.x and >= 3.0.2\nopenAPI.openapi.gte=3.0.2\n# tags property size should >= 1\nopenAPI.tags.size.gte=1\n# security property size must == 0\nopenAPI.security.size.eq=0\n\n#######################\n# Info Object\n#######################\n# description property is required\ninfo.description.required=true\n\n#######################\n# Tag Object\n#######################\n# name property, must be upper-camel-case\ntag.name.case=upper-camel-case\n# tag should be referenced by at least one Operation Object\ntag.name.must_be_referenced=true\n# description property, required\ntag.description.required=true\n\n#######################\n# Paths Object\n#######################\n# path must be lower-camel-case, including Path Templating variable\npaths.key.case=lower-camel-case\n\n#######################\n# Operation Object\n#######################\n# summary property, required\noperation.summary.required=true\n# operationId property, must be lower-camel-case\noperation.operationId.case=lower-camel-case\n# tags property, size must == 1\noperation.tags.size.eq=1\n# all tags should references which are defined in $.tags\noperation.tags.element.must_reference_root_tags=true\n# servers property, size must == 0\noperations.servers.size.eq=0\n\n#######################\n# Parameter Object\n#######################\n# description property, required\nparameter.description.required=true\n# name property, for header parameter, must be upper-hyphen-case\nparameter.name.header.case=upper-hyphen-case\n# name property, for cookie parameter, must be lower-camel-case\nparameter.name.cookie.case=lower-camel-case\n# name property, for path parameter, must be lower-camel-case\nparameter.name.path.case=lower-camel-case\n# name property, for query parameter, must be lower-camel-case\nparameter.name.query.case=lower-camel-case\n\n#######################\n# RequestBody Object\n#######################\n# description property, required\nrequestBody.description.required=true\n\n#######################\n# Response Object\n#######################\n# headers property's key must be upper-hyphen-case\nresponse.headers.key.case=upper-hyphen-case\n\n#######################\n# Schema Object\n#######################\n# title property, required if parent is Schema Object or Components Object\nschema.title.required=true\n# properties property, name(properties key) must be lower-camel-case\nschema.properties.key.case=lower-camel-case\n\n#######################\n# Encoding Object\n#######################\n# headers property's key must be upper-hyphen-case\nencoding.headers.key.case=upper-hyphen-case\n\n#######################\n# Header Object\n#######################\n# description property, required\nheader.description.required=true\n\n#######################\n# Components Object\n#######################\n# schemas property's key must be upper-camel-case\ncomponents.schemas.key.case=upper-camel-case\n# responses property's key must be upper-camel-case\ncomponents.responses.key.case=upper-camel-case\n# parameters property's key must be upper-camel-case\ncomponents.parameters.key.case=upper-camel-case\n# examples property's key must be upper-camel-case\ncomponents.examples.key.case=upper-camel-case\n# requestBodies property's key must be upper-camel-case\ncomponents.requestBodies.key.case=upper-camel-case\n# headers property's key must be upper-hyphen-case\ncomponents.headers.key.case=upper-hyphen-case\n# links property's key must be upper-camel-case\ncomponents.links.key.case=upper-hyphen-case\n# callbacks property's key must be upper-camel-case\ncomponents.callbacks.key.case=upper-camel-case\n# headers property's key must be upper-camel-case\ncomponents.headers.key.case=upper-camel-case\n```\n\n## Compatibility checking\n\nCheck whether new OAS spec compatibile with old spec.\n\nNotice: OAS could use [Reference Object][spec-reference], two  OAS which are different in text maybe semantically same. For example, below old OAS doesn't use [Reference Object][spec-reference] while the new one uses:\n\nOld OAS\n\n```yaml\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: List all pets\n      operationId: listPets\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: array\n              items:\n                type: object\n                properties:\n                  Foo:\n                    type: string\n      responses:\n        '200':\n          description: A paged array of pets\n```\n\nNew OAS\n\n```yaml\npaths:\n  /pets:\n    post:\n      operationId: listPets\n      requestBody:\n        content:\n          application/json: \n            schema:\n              $ref: '#/components/schemas/Foo'\n      responses:\n        '200':\n          description: A paged array of pets\ncomponents:\n  schemas:\n    Foo:\n      type: array\n      items:\n        type: object\n        properties:\n          Foo:\n            type: string\n```\n\nSo, when do compatibility check we resolve [Reference Object][spec-reference] in old and new OAS first, then do the check, below is the code snippet using [swagger-parser][swagger-parser]:\n\n```java\nOpenAPIV3Parser parser = new OpenAPIV3Parser();\n\nParseOptions parseOptions = new ParseOptions();\nparseOptions.setResolve(true);\nparseOptions.setResolveCombinators(true);\nparseOptions.setResolveFully(true);\nparseOptions.setFlatten(false);\n\nSwaggerParseResult parseResult = parser.readContents(content, null, parseOptions);\n```\n\nSo if  compatibility violations be found, the reported location will be different from the location in origin OAS spec.\n\n### Paths Object [doc][spec-paths]\n\n<a name=\"paths-compatibility\"></a>\n\n* New OAS must include all the `path` appears in 旧OAS. If `path` uses [Path Templating][spec-path-templating], even the variable name changed, will be considered semantically different. For example `/pets/{foo}` and `/pets/{bar}` are different.\n  * See [Path Item Object compatibility check rules](#path-item-compatibility)\n\n### Path Item Object [doc][spec-path-item]\n\n<a name=\"path-item-compatibility\"></a>\n\n* New OAS must inclued all old OAS get/put/post/delete/...[Operation Object][spec-operation]\n\n### Operation Object [doc][spec-operation]\n\n<a name=\"operation-compatibility\"></a>\n\n* `operationId` property,  new and old must be identical\n* `parameters` property, check work must also consider [Path Item Object parameters property][spec-path-item-parameters]:\n  * New OAS could add new [Parameter Object][spec-parameter], but the new [Parameter Object][spec-parameter] `required` property must be `false`\n  * New OAS could delete[Parameter Object][spec-parameter]\n  * The check on [Parameter Object][spec-parameter] see [Parameter Object compatibility check rules](#parameter-compatibility)(Under the same [Operation Object][spec-operation] [Parameter Object][spec-parameter] is identified by `name` and `in` property)。\n* `requestBody` property, see [Request Body Object compatibility check rules](#request-body-compatibility)\n* `responses` property, see[Responses Object compatibility check rules](#responses-compatibility)\n\n### Parameter Object [doc][spec-parameter]\n\n<a name=\"parameter-compatibility\"></a>\n\n* `required` property, only allow `true(old) -> false(new)` change\n* `allowEmptyValue` property, only allow `false(old) -> true(new)` change\n* `style` property, new and old must be identical\n* `explode` property, new and old must be identical\n* `allowReserved` property, only allow `false(old) -> true(new)` change\n* `schema` property, see [Schema Object compatibility check rules](#schema-compatibility)\n* `content`property, new OAS must include all old OAS media type (`content` keys), and add new media type is not allowed\n  * see [Media Type Object compatibility check rules](#media-type-compatibility)\n\n### Request Body Object [doc][spec-request-body]\n\n<a name=\"request-body-compatibility\"></a>\n\n* `content`property, new OAS must include all old OAS media type (`content` keys)\n  * See [Media Type Object compatibility check rules](#media-type-compatibility)\n* `required` property, only allow `true(old) -> false(new)` change\n\n### Media Type Object [doc][spec-media-type]\n\n<a name=\"media-type-compatibility\"></a>\n\n* `schema` property, see [Schema Object compatibility check rules](#schema-compatibility)\n* `encoding` property, this property only apply to `requestBody`, so new OAS and old OAS property name(`encoding` key) must be identical\n  * See [Encoding Object compatibility check rules](#encoding-compatibility)\n\n### Responses Object [doc][spec-responses]\n\n<a name=\"responses-compatibility\"></a>\n\n* `default` property, if old OAS doesn't define `default`, then new OAS should not define `default` too.\n* `{Http Status Code}` property, new OAS is not allowed to add one.\n* See [Response Object compatibility check rules](#response-compatibility)\n\n### Response Object [doc][spec-response]\n\n<a name=\"response-compatibility\"></a>\n\n* `headers` property, new OAS must include all old OAS header name(`headers` keys), and add new header name is allowed\n  * [Header Object][spec-header] see [Header Object compatibility check rules](#header-compatibility)\n* `content` property, new OAS must include all old OAS media type(`content` keys), and add new media type is allowed\n  - [Media Type Object][spec-media-type] see [Media Type Object compatibility check rules](#media-type-compatibility)\n\n### Schema Object [doc][spec-schema]\n\n<a name=\"schema-compatibility\"></a>\n\nOAS allows Schema Object be directly or indirectly in:\n\n* Request: [Parameter Object][spec-parameter], [Request Body Object][spec-request-body], [Header Object][spec-header]\n* Response: [Header Object][spec-header], [Response Object][spec-response]\n\nIn different context compatibility check rules are different.\n\n### In request context\n\nWhen Schema Object is in response context, only allow change from more specific form to less specific form.\n\n* `type, format` combination allowed change:\n\n| Old (type,format)  | New (type,format)                                              |\n| ---------------- | ------------------------------------------------------------ |\n| integer, null    | integer, int64<br />number, double<br />number, null         |\n| integer, int32   | integer, int64<br />integer, null<br />number, float<br />number, double<br />number, null |\n| integer, int64   | integer, null<br />number, double<br />number, null          |\n| number, null     | number, double                                               |\n| number, float    | number, null<br />number, double                             |\n| number, double   | number, null                                                 |\n| string, null     | string, password                                             |\n| string, password | string, null                                                 |\n\n* `allOf`, `oneOf`, `anyOf` property, combine them first then do check\n* `multipleOf` property, if old OAS is null, then new OAS must == old OAS or new OAS is a factor of old OAS, eg, 6(old)->3(new)\n* `maximum`, `maxLength`, `maxItems`, `maxProperties`, if old OAS is null, then new OAS must be null too. Otherwise, new OAS must be >= old OAS\n* `minimum`, `minLenght`, `minItems`, `minProperties`, if old OAS is null, then new OAS must be null too. Otherwise, new OAS must be <= old OAS.\n* `exclusiveMaximum`, `exclusiveMinimum` property, only allow change `true(old)->false(new)`\n* `uniqueItems` property, only allow change `true(old)->false(new)`\n* `required` property, new OAS must == old OAS or new OAS is old OAS subset\n* `enum` property, new OAS must == old OAS or new OAS is old OAS superset\n* `properties` property, new OAS could add or delete property name(`properties` key) \n* `nullable` property, only allow change `false(old)->true(new)`\n* `discriminator` property, new and old must be identical\n* `xml` property, new and old must be identical\n* `readOnly`, `writeOnly` property, new and old must be identical\n\n### In response context\n\nWhen Schema Object is in response context, only allow change from less specific form to more specific form.\n\n* `type, format` combination allowed change:\n\n| Old (type,format)  | New (type,format)                    |\n| ---------------- | ---------------------------------- |\n| integer, null    | integer, int64<br />integer, int32 |\n| integer, int64   | integer, null<br />interger, int32 |\n| number, null     | number, double<br />number, float  |\n| number, double   | number, null<br />number, float    |\n| string, null     | string, password                   |\n| string, password | string, null                       |\n\n* `allOf`, `oneOf`, `anyOf` property, combine them first then do check\n* `multipleOf` property if old OAS is null. new OAS must == old OAS or new OAS must be a multiple of old OAS, eg, 3(old)->6(new)\n* `maximum`, `maxLength`, `maxItems`, `maxProperties`, if old OAS is null, then new OAS must be null too. Otherwise, new OAS must <= old OAS\n* `minimum`, `minLenght`, `minItems`, `minProperties`, if old OAS is null, then new OAS must be null too. Otherwise, new OAS must >= old OAS\n* `exclusiveMaximum`, `exclusiveMinimum` property, only allow change  `false(old)->true(new)`\n* `uniqueItems` property, only allow change `false(old)->true(new)`\n* `required` new OAS must == old OAS or new OAS is old OAS superset\n* `enum` property, new OAS must == old OAS or new OAS is old OAS subset\n* `properties` property, new OAS could add or delete property name(`properties` key) \n* `nullable` property , only allow change `true(old)->false(new)`\n* `discriminator` property, new and old must be identical\n* `xml` property, new and old must be identical\n* `readOnly`, `writeOnly` property, new and old must be identical\n\n### Encoding Object [doc][spec-encoding]\n\n<a name=\"encoding-compatibility\"></a>\n\nNotice: Encoding Object only apply to Request Body Object\n\n* `contentType` property, new and old must be identical\n* `headers` property, new OAS can not add new he header name (`headers` key), but and delete header name\n  * [Header Object][spec-header] see [Header Object compatibility check rules](#header-compatibility)\n* `style` property, new and old must be identical\n* `explode` property, new and old must be identical\n* `allowReserved` property, only allow change `false(old) -> true(new)`\n\n### Header Object [doc][spec-header]\n\n<a name=\"header-compatibility\"></a>\n\n- `schema` property, see [Schema Object compatibility check rules](#schema-compatibility)\n\n### Components Object [doc][spec-components]\n\n<a name=\"components-compatibility\"></a>\n\n[Components Object][spec-components] defines reusable OAS Object, but when doing compatibility check all `$ref` are resolved, so no need to check [Components Object][spec-components] compatibility.\n\n\n[spec-operation]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\n[openapi-3.0.2]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md\n[spec-openapi]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#openapi-object\n[spec-server]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#serverObject\n[spec-info]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#infoObject\n[spec-paths]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#paths-object\n[spec-path-item]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathItemObject\n[spec-parameter]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject\n[spec-request-body]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#requestBodyObject\n[spec-security-scheme]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#securitySchemeObject\n[spec-components]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#components-object\n[spec-tag]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#tagObject\n[spec-schema]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject\n\n[spec-media-type]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#media-type-object\n[spec-response]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#response-object\n[spec-path-templating]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#path-templating\n[spec-parameterIn]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterIn\n[spec-encoding]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#encodingObject\n[spec-header]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#header-object\n[spec-info]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#infoObject\n[spec-reference]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#reference-object\n[swagger-parser]: https://github.com/swagger-api/swagger-parser\n[spec-path-item-parameters]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-pathitemparameters\n[spec-responses]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responsesObject\n"
  },
  {
    "path": "oas-validator/doc/INSTALLATION.MD",
    "content": "# INSTALLATION.MD\n\n## Prerequisites\n\n* Java 8\n* Maven\n\n## Building\n\n### Jar\n\n```\nmvn clean package\n```\n\n\n```\n./mvnw clean package\n```\n\n\n## Run\n\n### Maven\n\n```\nmvn clean package spring-boot:run\n```\n\n\n\n### Java\n\n```bash\njava -jar ./oas-validator-web/target/oas-validator-web-exec.jar\n```\n\n"
  },
  {
    "path": "oas-validator/doc/USAGE.MD",
    "content": "# 使用手册\n\n\n\n\n## 访问\n\n访问地址：[http://localhost:8080/](http://localhost:8080/)\n\n\n\n## 工具\n\n### 查看器\n\n敬请期待……\n\n\n\n### 编辑器\n\n敬请期待……\n\n\n\n### 验证器\n\n分为 **风格校验** 和 **兼容性检查**\n\n#### 风格校验\n\n对 OpenAPI Spec 文档进行规范验证，对违反规范的错误作出提示。\n\n\n\n##### 操作示例\n\n1. Step 1\n\n   ![](./compliance-1.png)\n\n2. Step 2\n\n   ![](./compliance-2.png)\n\n\n\n#### 兼容性检查\n\n对新旧两个 OpenAPI Spec 文档进行兼容性比较，检查出文档更新过程中出现的无法向下兼容的错误\n\n\n##### 操作示例\n\n1. Step 1\n\n   ![](./compatibility-1.png)\n\n2. Step 2\n\n   ![](./compatibility-2.png)\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n  <parent>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>oas-validator-parent</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <relativePath>../pom.xml</relativePath>\n  </parent>\n\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>oas-validator-compatibility</artifactId>\n\n  <dependencies>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-core</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-context</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.slf4j</groupId>\n      <artifactId>slf4j-api</artifactId>\n      <scope>provided</scope>\n    </dependency>\n\n    <!-- test deps -->\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-test</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-core-spring</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-test</artifactId>\n      <scope>test</scope>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-plugin</artifactId>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-report-plugin</artifactId>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/CompatibilityCheckParser.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility;\n\nimport io.swagger.v3.parser.OpenAPIV3Parser;\nimport io.swagger.v3.parser.core.models.ParseOptions;\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\n\npublic abstract class CompatibilityCheckParser {\n\n  private CompatibilityCheckParser() {\n    // singleton\n  }\n\n  public static SwaggerParseResult parseYaml(String yaml) {\n    OpenAPIV3Parser parser = new OpenAPIV3Parser();\n    return parser.readContents(yaml, null, createParseOptions());\n  }\n\n  private static ParseOptions createParseOptions() {\n\n    ParseOptions parseOptions = new ParseOptions();\n    parseOptions.setResolve(true);\n    parseOptions.setResolveCombinators(true);\n    parseOptions.setResolveFully(true);\n    parseOptions.setFlatten(false);\n    return parseOptions;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultCallbackDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.CallbackDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.CallbackDiffValidatorFactory;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultCallbackDiffValidatorFactory implements CallbackDiffValidatorFactory {\n\n  @Override\n  public List<CallbackDiffValidator> create() {\n    return Collections.emptyList();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultComponentsDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ComponentsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.CallbackDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.ComponentsDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.HeaderDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.LinkDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.ParameterDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.RequestBodyDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.ResponseDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components.ComponentsCallbacksDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components.ComponentsHeadersDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components.ComponentsLinksDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components.ComponentsParametersDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components.ComponentsRequestBodiesDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components.ComponentsResponsesDiffValidator;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultComponentsDiffValidatorFactory implements ComponentsDiffValidatorFactory {\n\n  private final CallbackDiffValidatorFactory callbackDiffValidatorFactory;\n\n  private final HeaderDiffValidatorFactory headerDiffValidatorFactory;\n\n  private final LinkDiffValidatorFactory linkDiffValidatorFactory;\n\n  private final ParameterDiffValidatorFactory parameterDiffValidatorFactory;\n\n  private final RequestBodyDiffValidatorFactory requestBodyDiffValidatorFactory;\n\n  private final ResponseDiffValidatorFactory responseDiffValidatorFactory;\n\n  public DefaultComponentsDiffValidatorFactory(\n      CallbackDiffValidatorFactory callbackDiffValidatorFactory,\n      HeaderDiffValidatorFactory headerDiffValidatorFactory,\n      LinkDiffValidatorFactory linkDiffValidatorFactory,\n      ParameterDiffValidatorFactory parameterDiffValidatorFactory,\n      RequestBodyDiffValidatorFactory requestBodyDiffValidatorFactory,\n      ResponseDiffValidatorFactory responseDiffValidatorFactory) {\n    this.callbackDiffValidatorFactory = callbackDiffValidatorFactory;\n    this.headerDiffValidatorFactory = headerDiffValidatorFactory;\n    this.linkDiffValidatorFactory = linkDiffValidatorFactory;\n    this.parameterDiffValidatorFactory = parameterDiffValidatorFactory;\n    this.requestBodyDiffValidatorFactory = requestBodyDiffValidatorFactory;\n    this.responseDiffValidatorFactory = responseDiffValidatorFactory;\n  }\n\n  @Override\n  public List<ComponentsDiffValidator> create() {\n\n    List<ComponentsDiffValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new ComponentsCallbacksDiffValidator(callbackDiffValidatorFactory.create()));\n    validators.add(new ComponentsHeadersDiffValidator(headerDiffValidatorFactory.create()));\n    validators.add(new ComponentsLinksDiffValidator(linkDiffValidatorFactory.create()));\n    validators.add(new ComponentsParametersDiffValidator(parameterDiffValidatorFactory.create()));\n    validators.add(new ComponentsRequestBodiesDiffValidator(requestBodyDiffValidatorFactory.create()));\n    validators.add(new ComponentsResponsesDiffValidator(responseDiffValidatorFactory.create()));\n\n    // concretes\n\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultEncodingDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding.EncodingAddNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding.EncodingAllowedReservedChangeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding.EncodingContentTypeNotSameDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding.EncodingDelNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding.EncodingExplodeNotSameDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding.EncodingStyleNotSameDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.EncodingDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.HeaderDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.encoding.EncodingHeadersDiffValidator;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultEncodingDiffValidatorFactory implements EncodingDiffValidatorFactory {\n\n  private final HeaderDiffValidatorFactory headerDiffValidatorFactory;\n\n  public DefaultEncodingDiffValidatorFactory(\n      HeaderDiffValidatorFactory headerDiffValidatorFactory) {\n    this.headerDiffValidatorFactory = headerDiffValidatorFactory;\n  }\n\n  @Override\n  public List<EncodingDiffValidator> create() {\n\n    List<EncodingDiffValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new EncodingHeadersDiffValidator(headerDiffValidatorFactory.create()));\n\n    // concretes\n    validators.add(new EncodingAddNotAllowedDiffValidator());\n    validators.add(new EncodingDelNotAllowedDiffValidator());\n    validators.add(new EncodingAllowedReservedChangeDiffValidator());\n    validators.add(new EncodingContentTypeNotSameDiffValidator());\n    validators.add(new EncodingExplodeNotSameDiffValidator());\n    validators.add(new EncodingStyleNotSameDiffValidator());\n\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultHeaderDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.header.HeaderAddInRequestBodyNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.header.HeaderDelInResponseNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.HeaderDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.HeaderDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.SchemaDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.header.HeaderSchemaDiffValidator;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultHeaderDiffValidatorFactory implements HeaderDiffValidatorFactory {\n\n  private final SchemaDiffValidatorFactory schemaDiffValidatorFactory;\n\n  public DefaultHeaderDiffValidatorFactory(\n      SchemaDiffValidatorFactory schemaDiffValidatorFactory) {\n    this.schemaDiffValidatorFactory = schemaDiffValidatorFactory;\n  }\n\n  @Override\n  public List<HeaderDiffValidator> create() {\n\n    List<HeaderDiffValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new HeaderSchemaDiffValidator(schemaDiffValidatorFactory.create()));\n\n    // concretes\n    validators.add(new HeaderAddInRequestBodyNotAllowedDiffValidator());\n    validators.add(new HeaderDelInResponseNotAllowedDiffValidator());\n\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultInfoDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.InfoDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.InfoDiffValidatorFactory;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultInfoDiffValidatorFactory implements InfoDiffValidatorFactory {\n\n  @Override\n  public List<InfoDiffValidator> create() {\n    return Collections.emptyList();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultLinkDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.LinkDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.LinkDiffValidatorFactory;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultLinkDiffValidatorFactory implements LinkDiffValidatorFactory {\n\n  @Override\n  public List<LinkDiffValidator> create() {\n    return Collections.emptyList();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultMediaTypeDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype.MediaTypeAddInParameterNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype.MediaTypeDelInParameterNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype.MediaTypeDelInRequestBodyNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype.MediaTypeDelInResponseNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MediaTypeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.EncodingDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.MediaTypeDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.SchemaDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.mediatype.MediaTypeEncodingDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.mediatype.MediaTypeSchemaDiffValidator;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultMediaTypeDiffValidatorFactory implements MediaTypeDiffValidatorFactory {\n\n  private final EncodingDiffValidatorFactory encodingDiffValidatorFactory;\n\n  private final SchemaDiffValidatorFactory schemaDiffValidatorFactory;\n\n  public DefaultMediaTypeDiffValidatorFactory(\n      EncodingDiffValidatorFactory encodingDiffValidatorFactory,\n      SchemaDiffValidatorFactory schemaDiffValidatorFactory) {\n    this.encodingDiffValidatorFactory = encodingDiffValidatorFactory;\n    this.schemaDiffValidatorFactory = schemaDiffValidatorFactory;\n  }\n\n  @Override\n  public List<MediaTypeDiffValidator> create() {\n\n    List<MediaTypeDiffValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new MediaTypeEncodingDiffValidator(encodingDiffValidatorFactory.create()));\n    validators.add(new MediaTypeSchemaDiffValidator(schemaDiffValidatorFactory.create()));\n\n    // concretes\n    validators.add(new MediaTypeAddInParameterNotAllowedDiffValidator());\n    validators.add(new MediaTypeDelInParameterNotAllowedDiffValidator());\n    validators.add(new MediaTypeDelInRequestBodyNotAllowedDiffValidator());\n    validators.add(new MediaTypeDelInResponseNotAllowedDiffValidator());\n\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultOasSpecDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DefaultOasSpecDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasSpecDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.OasSpecDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.OpenApiDiffValidatorFactory;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultOasSpecDiffValidatorFactory implements OasSpecDiffValidatorFactory {\n\n  private final OpenApiDiffValidatorFactory openApiDiffValidatorFactory;\n\n  public DefaultOasSpecDiffValidatorFactory(\n      OpenApiDiffValidatorFactory openApiDiffValidatorFactory) {\n    this.openApiDiffValidatorFactory = openApiDiffValidatorFactory;\n  }\n\n  @Override\n  public OasSpecDiffValidator create() {\n    return new DefaultOasSpecDiffValidator(openApiDiffValidatorFactory.create());\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultOpenApiDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OpenApiDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.ComponentsDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.InfoDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.OpenApiDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.PathsDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.ServerDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.TagDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi.OpenApiComponentsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi.OpenApiInfoDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi.OpenApiPathsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi.OpenApiServersDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi.OpenApiTagsDiffValidator;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultOpenApiDiffValidatorFactory implements OpenApiDiffValidatorFactory {\n\n  private final ComponentsDiffValidatorFactory componentsDiffValidatorFactory;\n\n  private final InfoDiffValidatorFactory infoDiffValidatorFactory;\n\n  private final PathsDiffValidatorFactory pathsDiffValidatorFactory;\n\n  private final ServerDiffValidatorFactory serverDiffValidatorFactory;\n\n  private final TagDiffValidatorFactory tagDiffValidatorFactory;\n\n  public DefaultOpenApiDiffValidatorFactory(\n      ComponentsDiffValidatorFactory componentsDiffValidatorFactory,\n      InfoDiffValidatorFactory infoDiffValidatorFactory,\n      PathsDiffValidatorFactory pathsDiffValidatorFactory,\n      ServerDiffValidatorFactory serverDiffValidatorFactory,\n      TagDiffValidatorFactory tagDiffValidatorFactory) {\n    this.componentsDiffValidatorFactory = componentsDiffValidatorFactory;\n    this.infoDiffValidatorFactory = infoDiffValidatorFactory;\n    this.pathsDiffValidatorFactory = pathsDiffValidatorFactory;\n    this.serverDiffValidatorFactory = serverDiffValidatorFactory;\n    this.tagDiffValidatorFactory = tagDiffValidatorFactory;\n  }\n\n  @Override\n  public List<OpenApiDiffValidator> create() {\n\n    List<OpenApiDiffValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new OpenApiComponentsDiffValidator(componentsDiffValidatorFactory.create()));\n    validators.add(new OpenApiInfoDiffValidator(infoDiffValidatorFactory.create()));\n    validators.add(new OpenApiPathsDiffValidator(pathsDiffValidatorFactory.create()));\n    validators.add(new OpenApiServersDiffValidator(serverDiffValidatorFactory.create()));\n    validators.add(new OpenApiTagsDiffValidator(tagDiffValidatorFactory.create()));\n\n    // concretes\n\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultOperationDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.operation.OperationDeleteNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.operation.OperationIdNotSameDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OperationDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.OperationDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.ParameterDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.RequestBodyDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.ResponsesDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.operation.OperationParametersDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.operation.OperationRequestBodyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.operation.OperationResponsesDiffValidator;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultOperationDiffValidatorFactory implements OperationDiffValidatorFactory {\n\n  private final ParameterDiffValidatorFactory parameterDiffValidatorFactory;\n\n  private final RequestBodyDiffValidatorFactory requestBodyDiffValidatorFactory;\n\n  private final ResponsesDiffValidatorFactory responsesDiffValidatorFactory;\n\n  public DefaultOperationDiffValidatorFactory(\n      ParameterDiffValidatorFactory parameterDiffValidatorFactory,\n      RequestBodyDiffValidatorFactory requestBodyDiffValidatorFactory,\n      ResponsesDiffValidatorFactory responsesDiffValidatorFactory) {\n    this.parameterDiffValidatorFactory = parameterDiffValidatorFactory;\n    this.requestBodyDiffValidatorFactory = requestBodyDiffValidatorFactory;\n    this.responsesDiffValidatorFactory = responsesDiffValidatorFactory;\n  }\n\n  @Override\n  public List<OperationDiffValidator> create() {\n\n    List<OperationDiffValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new OperationParametersDiffValidator(parameterDiffValidatorFactory.create()));\n    validators.add(new OperationRequestBodyDiffValidator(requestBodyDiffValidatorFactory.create()));\n    validators.add(new OperationResponsesDiffValidator(responsesDiffValidatorFactory.create()));\n\n    // concretes\n    validators.add(new OperationDeleteNotAllowedDiffValidator());\n    validators.add(new OperationIdNotSameDiffValidator());\n\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultParameterDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter.ParameterAddDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter.ParameterAllowEmptyValueChangeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter.ParameterAllowReservedChangeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter.ParameterExplodeNotSameDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter.ParameterRequiredChangeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter.ParameterStyleNotSameDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.MediaTypeDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.ParameterDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.SchemaDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.parameter.ParameterContentDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.parameter.ParameterSchemaDiffValidator;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultParameterDiffValidatorFactory implements ParameterDiffValidatorFactory {\n\n\n  private final MediaTypeDiffValidatorFactory mediaTypeDiffValidatorFactory;\n\n  private final SchemaDiffValidatorFactory schemaDiffValidatorFactory;\n\n  public DefaultParameterDiffValidatorFactory(\n      MediaTypeDiffValidatorFactory mediaTypeDiffValidatorFactory,\n      SchemaDiffValidatorFactory schemaDiffValidatorFactory) {\n    this.mediaTypeDiffValidatorFactory = mediaTypeDiffValidatorFactory;\n    this.schemaDiffValidatorFactory = schemaDiffValidatorFactory;\n  }\n\n  @Override\n  public List<ParameterDiffValidator> create() {\n\n    List<ParameterDiffValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new ParameterContentDiffValidator(mediaTypeDiffValidatorFactory.create()));\n    validators.add(new ParameterSchemaDiffValidator(schemaDiffValidatorFactory.create()));\n\n    // concretes\n    validators.add(new ParameterAddDiffValidator());\n    validators.add(new ParameterRequiredChangeDiffValidator());\n    validators.add(new ParameterAllowEmptyValueChangeDiffValidator());\n    validators.add(new ParameterStyleNotSameDiffValidator());\n    validators.add(new ParameterExplodeNotSameDiffValidator());\n    validators.add(new ParameterAllowReservedChangeDiffValidator());\n\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultPathItemDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.pathitem.PathItemDeleteNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.PathItemDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.OperationDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.ParameterDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.PathItemDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.pathitem.PathItemOperationsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.pathitem.PathItemParametersDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.paths.PathsPathItemsDiffValidator;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultPathItemDiffValidatorFactory implements PathItemDiffValidatorFactory {\n\n  private final OperationDiffValidatorFactory operationDiffValidatorFactory;\n  private final ParameterDiffValidatorFactory parameterDiffValidatorFactory;\n\n  public DefaultPathItemDiffValidatorFactory(\n      OperationDiffValidatorFactory operationDiffValidatorFactory,\n      ParameterDiffValidatorFactory parameterDiffValidatorFactory) {\n    this.operationDiffValidatorFactory = operationDiffValidatorFactory;\n    this.parameterDiffValidatorFactory = parameterDiffValidatorFactory;\n  }\n\n  @Override\n  public List<PathItemDiffValidator> create() {\n\n    List<PathItemDiffValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new PathItemOperationsDiffValidator(operationDiffValidatorFactory.create()));\n    validators.add(new PathItemParametersDiffValidator(parameterDiffValidatorFactory.create()));\n\n    // concretes\n    validators.add(new PathItemDeleteNotAllowedDiffValidator());\n\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultPathsDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.PathsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.PathItemDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.PathsDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.paths.PathsPathItemsDiffValidator;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultPathsDiffValidatorFactory implements PathsDiffValidatorFactory {\n\n  private final PathItemDiffValidatorFactory pathItemDiffValidatorFactory;\n\n  public DefaultPathsDiffValidatorFactory(\n      PathItemDiffValidatorFactory pathItemDiffValidatorFactory) {\n    this.pathItemDiffValidatorFactory = pathItemDiffValidatorFactory;\n  }\n\n  @Override\n  public List<PathsDiffValidator> create() {\n\n    List<PathsDiffValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new PathsPathItemsDiffValidator(pathItemDiffValidatorFactory.create()));\n\n    // concretes\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultRequestBodyDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.requestbody.RequestBodyRequiredChangeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.RequestBodyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.MediaTypeDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.RequestBodyDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.requestbody.RequestBodyContentDiffValidator;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultRequestBodyDiffValidatorFactory implements RequestBodyDiffValidatorFactory {\n\n  private final MediaTypeDiffValidatorFactory mediaTypeDiffValidatorFactory;\n\n  public DefaultRequestBodyDiffValidatorFactory(\n      MediaTypeDiffValidatorFactory mediaTypeDiffValidatorFactory) {\n    this.mediaTypeDiffValidatorFactory = mediaTypeDiffValidatorFactory;\n  }\n\n  @Override\n  public List<RequestBodyDiffValidator> create() {\n\n    List<RequestBodyDiffValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new RequestBodyContentDiffValidator(mediaTypeDiffValidatorFactory.create()));\n\n    // concretes\n    validators.add(new RequestBodyRequiredChangeDiffValidator());\n\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultResponseDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.response.ResponseAddNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ResponseDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.HeaderDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.MediaTypeDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.ResponseDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.response.ResponseContentDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.response.ResponseHeadersDiffValidator;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultResponseDiffValidatorFactory implements ResponseDiffValidatorFactory {\n\n  private final MediaTypeDiffValidatorFactory mediaTypeDiffValidatorFactory;\n\n  private final HeaderDiffValidatorFactory headerDiffValidatorFactory;\n\n  public DefaultResponseDiffValidatorFactory(\n      MediaTypeDiffValidatorFactory mediaTypeDiffValidatorFactory,\n      HeaderDiffValidatorFactory headerDiffValidatorFactory) {\n    this.mediaTypeDiffValidatorFactory = mediaTypeDiffValidatorFactory;\n    this.headerDiffValidatorFactory = headerDiffValidatorFactory;\n  }\n\n  @Override\n  public List<ResponseDiffValidator> create() {\n\n    List<ResponseDiffValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new ResponseContentDiffValidator(mediaTypeDiffValidatorFactory.create()));\n    validators.add(new ResponseHeadersDiffValidator(headerDiffValidatorFactory.create()));\n\n    // concretes\n    validators.add(new ResponseAddNotAllowedDiffValidator());\n\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultResponsesDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ResponsesDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.ResponseDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.ResponsesDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.responses.ResponsesResponsesDiffValidator;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultResponsesDiffValidatorFactory implements ResponsesDiffValidatorFactory {\n\n  private final ResponseDiffValidatorFactory responseDiffValidatorFactory;\n\n  public DefaultResponsesDiffValidatorFactory(\n      ResponseDiffValidatorFactory responseDiffValidatorFactory) {\n    this.responseDiffValidatorFactory = responseDiffValidatorFactory;\n  }\n\n  @Override\n  public List<ResponsesDiffValidator> create() {\n\n    List<ResponsesDiffValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new ResponsesResponsesDiffValidator(responseDiffValidatorFactory.create()));\n\n    // concretes\n\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultSchemaDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaDiscriminatorChangeValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaReadOnlyChangeValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaWriteOnlyChangeValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaXmlChangeValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaEnumChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaExclusiveMaximumChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaExclusiveMinimumChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaMaxItemsChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaMaxLengthChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaMaxPropertiesChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaMaximumChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaMinItemsChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaMinLengthChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaMinPropertiesChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaMinimumChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaMultipleOfChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaNullableChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaRequiredChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaTypeFormatChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.SchemaUniqueItemsChangeInRequestValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaEnumChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaExclusiveMaximumChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaExclusiveMinimumChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaMaxItemsChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaMaxLengthChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaMaxPropertiesChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaMaximumChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaMinItemsChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaMinLengthChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaMinPropertiesChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaMinimumChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaMultipleOfChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaNullableChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaRequiredChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaTypeFormatChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.SchemaUniqueItemsChangeInResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.SchemaDiffValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.schema.SchemaDiffValidatorEngine;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultSchemaDiffValidatorFactory implements SchemaDiffValidatorFactory {\n\n\n  @Override\n  public List<SchemaDiffValidator> create() {\n\n    List<SchemaDiffValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new SchemaDiffValidatorEngine(\n        Collections.emptyList(),\n        Collections.emptyList(),\n        compareValidators()\n    ));\n\n    // concretes\n\n    return Collections.unmodifiableList(validators);\n  }\n\n  private List<SchemaCompareValidator> compareValidators() {\n\n    List<SchemaCompareValidator> compareValidators = new ArrayList<>();\n\n    // in common conntext\n    compareValidators.add(new SchemaReadOnlyChangeValidator());\n    compareValidators.add(new SchemaWriteOnlyChangeValidator());\n    compareValidators.add(new SchemaXmlChangeValidator());\n    compareValidators.add(new SchemaDiscriminatorChangeValidator());\n\n    // for request context\n    compareValidators.add(new SchemaTypeFormatChangeInRequestValidator());\n    compareValidators.add(new SchemaMaximumChangeInRequestValidator());\n    compareValidators.add(new SchemaExclusiveMinimumChangeInRequestValidator());\n    compareValidators.add(new SchemaExclusiveMaximumChangeInRequestValidator());\n    compareValidators.add(new SchemaMultipleOfChangeInRequestValidator());\n    compareValidators.add(new SchemaMaxItemsChangeInRequestValidator());\n    compareValidators.add(new SchemaMaxLengthChangeInRequestValidator());\n    compareValidators.add(new SchemaMaxPropertiesChangeInRequestValidator());\n    compareValidators.add(new SchemaMinimumChangeInRequestValidator());\n    compareValidators.add(new SchemaMinItemsChangeInRequestValidator());\n    compareValidators.add(new SchemaMinLengthChangeInRequestValidator());\n    compareValidators.add(new SchemaMinPropertiesChangeInRequestValidator());\n    compareValidators.add(new SchemaUniqueItemsChangeInRequestValidator());\n    compareValidators.add(new SchemaRequiredChangeInRequestValidator());\n    compareValidators.add(new SchemaEnumChangeInRequestValidator());\n    compareValidators.add(new SchemaNullableChangeInRequestValidator());\n\n    // for response context\n    compareValidators.add(new SchemaTypeFormatChangeInResponseValidator());\n    compareValidators.add(new SchemaMaximumChangeInResponseValidator());\n    compareValidators.add(new SchemaExclusiveMinimumChangeInResponseValidator());\n    compareValidators.add(new SchemaExclusiveMaximumChangeInResponseValidator());\n    compareValidators.add(new SchemaMultipleOfChangeInResponseValidator());\n    compareValidators.add(new SchemaMaxItemsChangeInResponseValidator());\n    compareValidators.add(new SchemaMaxLengthChangeInResponseValidator());\n    compareValidators.add(new SchemaMaxPropertiesChangeInResponseValidator());\n    compareValidators.add(new SchemaMinimumChangeInResponseValidator());\n    compareValidators.add(new SchemaMinItemsChangeInResponseValidator());\n    compareValidators.add(new SchemaMinLengthChangeInResponseValidator());\n    compareValidators.add(new SchemaMinPropertiesChangeInResponseValidator());\n    compareValidators.add(new SchemaUniqueItemsChangeInResponseValidator());\n    compareValidators.add(new SchemaRequiredChangeInResponseValidator());\n    compareValidators.add(new SchemaEnumChangeInResponseValidator());\n    compareValidators.add(new SchemaNullableChangeInResponseValidator());\n\n    return Collections.unmodifiableList(compareValidators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultSecuritySchemeDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SecuritySchemeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.SecuritySchemeDiffValidatorFactory;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultSecuritySchemeDiffValidatorFactory implements SecuritySchemeDiffValidatorFactory {\n\n\n  @Override\n  public List<SecuritySchemeDiffValidator> create() {\n    return Collections.emptyList();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultServerDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ServerDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.ServerDiffValidatorFactory;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultServerDiffValidatorFactory implements ServerDiffValidatorFactory {\n\n  @Override\n  public List<ServerDiffValidator> create() {\n    return Collections.emptyList();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultTagDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.TagDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.factory.TagDiffValidatorFactory;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultTagDiffValidatorFactory implements TagDiffValidatorFactory {\n\n  @Override\n  public List<TagDiffValidator> create() {\n    return Collections.emptyList();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/EncodingAddNotAllowedDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.media.Encoding;\n\nimport java.util.List;\n\nimport static java.util.Collections.singletonList;\n\npublic class EncodingAddNotAllowedDiffValidator\n  extends OasObjectDiffValidatorTemplate<Encoding>\n  implements EncodingDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateAdd(OasDiffValidationContext context,\n    OasObjectPropertyLocation rightLocation, Encoding rightOasObject) {\n    return singletonList(OasDiffViolation.onlyRight(rightLocation, DiffViolationMessages.OP_ADD_FORBIDDEN));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/EncodingAllowedReservedChangeDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasObjectDiffValidatorTemplate;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport io.swagger.v3.oas.models.media.Encoding;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.apache.commons.lang3.ObjectUtils.defaultIfNull;\n\npublic class EncodingAllowedReservedChangeDiffValidator\n  extends OasObjectDiffValidatorTemplate<Encoding>\n  implements EncodingDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Encoding leftOasObject, OasObjectPropertyLocation rightLocation,\n    Encoding rightOasObject) {\n\n    if (ChangeRangeCheckUtils.isNotViolated(\n      defaultIfNull(leftOasObject.getAllowReserved(), Boolean.FALSE),\n      defaultIfNull(rightOasObject.getAllowReserved(), Boolean.FALSE),\n      singletonList(new Object[] { false, true }))) {\n      return emptyList();\n    }\n\n    return singletonList(new OasDiffViolation(\n      leftLocation.property(\"allowReserved\"),\n      rightLocation.property(\"allowReserved\"),\n      DiffViolationMessages.FALSE_TO_TRUE\n    ));\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/EncodingContentTypeNotSameDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.media.Encoding;\n\nimport java.util.List;\nimport java.util.Objects;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\npublic class EncodingContentTypeNotSameDiffValidator\n  extends OasObjectDiffValidatorTemplate<Encoding>\n  implements EncodingDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Encoding leftOasObject, OasObjectPropertyLocation rightLocation,\n    Encoding rightOasObject) {\n\n    if (Objects.equals(leftOasObject.getContentType(), rightOasObject.getContentType())) {\n      return emptyList();\n    }\n\n    return singletonList(new OasDiffViolation(\n      leftLocation.property(\"contentType\"),\n      rightLocation.property(\"contentType\"),\n      DiffViolationMessages.NEW_NOT_EQ_OLD\n    ));\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/EncodingDelNotAllowedDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.media.Encoding;\n\nimport java.util.List;\n\nimport static java.util.Collections.singletonList;\n\npublic class EncodingDelNotAllowedDiffValidator\n  extends OasObjectDiffValidatorTemplate<Encoding>\n  implements EncodingDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateDel(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    Encoding leftOasObject) {\n    return singletonList(OasDiffViolation.onlyLeft(leftLocation, DiffViolationMessages.OP_DEL_FORBIDDEN));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/EncodingExplodeNotSameDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.media.Encoding;\n\nimport java.util.List;\nimport java.util.Objects;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\npublic class EncodingExplodeNotSameDiffValidator\n  extends OasObjectDiffValidatorTemplate<Encoding>\n  implements EncodingDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Encoding leftOasObject, OasObjectPropertyLocation rightLocation,\n    Encoding rightOasObject) {\n\n    if (Objects.equals(leftOasObject.getExplode(), rightOasObject.getExplode())) {\n      return emptyList();\n    }\n\n    return singletonList(new OasDiffViolation(\n      leftLocation.property(\"explode\"),\n      rightLocation.property(\"explode\"),\n      DiffViolationMessages.NEW_NOT_EQ_OLD\n    ));\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/EncodingStyleNotSameDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.media.Encoding;\n\nimport java.util.List;\nimport java.util.Objects;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\npublic class EncodingStyleNotSameDiffValidator\n  extends OasObjectDiffValidatorTemplate<Encoding>\n  implements EncodingDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Encoding leftOasObject, OasObjectPropertyLocation rightLocation,\n    Encoding rightOasObject) {\n\n    if (Objects.equals(leftOasObject.getStyle(), rightOasObject.getStyle())) {\n      return emptyList();\n    }\n\n    return singletonList(new OasDiffViolation(\n      leftLocation.property(\"style\"),\n      rightLocation.property(\"style\"),\n      DiffViolationMessages.NEW_NOT_EQ_OLD\n    ));\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/header/HeaderAddInRequestBodyNotAllowedDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.header;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.headers.Header;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\n/**\n * Adding Header Object under requestBody.content.'mediaType'.encoding.'encoding'.headers is not allowed\n */\npublic class HeaderAddInRequestBodyNotAllowedDiffValidator extends OasObjectDiffValidatorTemplate<Header>\n  implements HeaderDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateAdd(OasDiffValidationContext context,\n    OasObjectPropertyLocation rightLocation, Header rightOasObject) {\n    if (!isInRequestBody(context)) {\n      return emptyList();\n    }\n    return singletonList(OasDiffViolation.onlyRight(rightLocation, DiffViolationMessages.OP_ADD_FORBIDDEN));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/header/HeaderDelInResponseNotAllowedDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.header;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.headers.Header;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\n/**\n * Deleting Header Object under responses.'response'.headers.headers is not allowed\n */\npublic class HeaderDelInResponseNotAllowedDiffValidator extends OasObjectDiffValidatorTemplate<Header>\n  implements HeaderDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateDel(OasDiffValidationContext context,\n    OasObjectPropertyLocation rightLocation, Header rightOasObject) {\n    if (!isInResponse(context)) {\n      return emptyList();\n    }\n    return singletonList(OasDiffViolation.onlyLeft(rightLocation, DiffViolationMessages.OP_DEL_FORBIDDEN));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/MediaTypeAddInParameterNotAllowedDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.media.MediaType;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\n/**\n * Adding MediaType Object under Parameter.content is not allowed\n */\npublic class MediaTypeAddInParameterNotAllowedDiffValidator\n  extends OasObjectDiffValidatorTemplate<MediaType>\n  implements MediaTypeDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateAdd(OasDiffValidationContext context,\n    OasObjectPropertyLocation rightLocation, MediaType rightOasObject) {\n    if (!isInParameter(context)) {\n      return emptyList();\n    }\n    return singletonList(OasDiffViolation.onlyRight(rightLocation, DiffViolationMessages.OP_ADD_FORBIDDEN));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/MediaTypeDelInParameterNotAllowedDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.media.MediaType;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\n/**\n * Deleting MediaType Object under Parameter.content is not allowed\n */\npublic class MediaTypeDelInParameterNotAllowedDiffValidator\n  extends OasObjectDiffValidatorTemplate<MediaType>\n  implements MediaTypeDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateDel(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    MediaType leftOasObject) {\n    if (!isInParameter(context)) {\n      return emptyList();\n    }\n    return singletonList(OasDiffViolation.onlyLeft(leftLocation, DiffViolationMessages.OP_DEL_FORBIDDEN));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/MediaTypeDelInRequestBodyNotAllowedDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.media.MediaType;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\n/**\n * Deleting MediaType Object under RequestBody.content is not allowed\n */\npublic class MediaTypeDelInRequestBodyNotAllowedDiffValidator\n  extends OasObjectDiffValidatorTemplate<MediaType>\n  implements MediaTypeDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateDel(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    MediaType leftOasObject) {\n    if (!isInRequestBody(context)) {\n      return emptyList();\n    }\n    return singletonList(OasDiffViolation.onlyLeft(leftLocation, DiffViolationMessages.OP_DEL_FORBIDDEN));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/MediaTypeDelInResponseNotAllowedDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.media.MediaType;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\n/**\n * Deleting MediaType Object under responses.'response'.content.'mediaType' is not allowed\n */\npublic class MediaTypeDelInResponseNotAllowedDiffValidator\n  extends OasObjectDiffValidatorTemplate<MediaType>\n  implements MediaTypeDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateDel(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    MediaType leftOasObject) {\n    if (!isInResponse(context)) {\n      return emptyList();\n    }\n    return singletonList(OasDiffViolation.onlyLeft(leftLocation, DiffViolationMessages.OP_DEL_FORBIDDEN));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/operation/OperationDeleteNotAllowedDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.operation;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.Operation;\n\nimport java.util.List;\n\nimport static java.util.Collections.singletonList;\n\npublic class OperationDeleteNotAllowedDiffValidator\n  extends OasObjectDiffValidatorTemplate<Operation>\n  implements OperationDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateDel(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    Operation leftOasObject) {\n\n    return singletonList(OasDiffViolation.onlyLeft(leftLocation, DiffViolationMessages.OP_DEL_FORBIDDEN));\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/operation/OperationIdNotSameDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.operation;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.Operation;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\npublic class OperationIdNotSameDiffValidator\n  extends OasObjectDiffValidatorTemplate<Operation>\n  implements OperationDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Operation leftOasObject, OasObjectPropertyLocation rightLocation,\n    Operation rightOasObject) {\n    if (leftOasObject.getOperationId().equalsIgnoreCase(rightOasObject.getOperationId())) {\n      return emptyList();\n    }\n    return singletonList(new OasDiffViolation(\n      leftLocation.property(\"operationId\"),\n      rightLocation.property(\"operationId\"),\n      DiffViolationMessages.NEW_NOT_EQ_OLD));\n\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/ParameterAddDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasObjectDiffValidatorTemplate;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ParameterUtils;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\npublic class ParameterAddDiffValidator\n  extends OasObjectDiffValidatorTemplate<Parameter>\n  implements ParameterDiffValidator {\n\n  public static final String VIOLATION_MESSAGE = \"required=true parameter is not allowed on right side\";\n\n  @Override\n  protected List<OasDiffViolation> validateAdd(OasDiffValidationContext context,\n    OasObjectPropertyLocation rightLocation, Parameter rightOasObject) {\n\n    if (Boolean.FALSE.equals(rightOasObject.getRequired())) {\n      return emptyList();\n    }\n\n    String message = new StringBuilder()\n      .append(ParameterUtils.getKeyString(rightOasObject))\n      .append(':')\n      .append(VIOLATION_MESSAGE)\n      .toString()\n      ;\n\n    return singletonList(OasDiffViolation.onlyRight(rightLocation.property(\"required\"), message));\n\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/ParameterAllowEmptyValueChangeDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasObjectDiffValidatorTemplate;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ParameterUtils;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.apache.commons.lang3.ObjectUtils.defaultIfNull;\n\n/**\n * Parameter.allowEmpty only allow change false to true\n */\npublic class ParameterAllowEmptyValueChangeDiffValidator\n  extends OasObjectDiffValidatorTemplate<Parameter>\n  implements ParameterDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Parameter leftOasObject, OasObjectPropertyLocation rightLocation,\n    Parameter rightOasObject) {\n\n\n    if (ChangeRangeCheckUtils.isNotViolated(\n      defaultIfNull(leftOasObject.getAllowEmptyValue(), Boolean.FALSE),\n      defaultIfNull(rightOasObject.getAllowEmptyValue(), Boolean.FALSE),\n      singletonList(new Object[] { false, true }))) {\n      return emptyList();\n    }\n\n    String message = new StringBuilder()\n      .append(ParameterUtils.getKeyString(rightOasObject))\n      .append(':')\n      .append(DiffViolationMessages.FALSE_TO_TRUE)\n      .toString();\n\n    return singletonList(new OasDiffViolation(\n      leftLocation.property(\"allowEmptyValue\"),\n      rightLocation.property(\"allowEmptyValue\"),\n      message\n    ));\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/ParameterAllowReservedChangeDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasObjectDiffValidatorTemplate;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ParameterUtils;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.apache.commons.lang3.ObjectUtils.defaultIfNull;\n\n/**\n * Parameter.allowReserved only allow change false to true\n */\npublic class ParameterAllowReservedChangeDiffValidator\n  extends OasObjectDiffValidatorTemplate<Parameter>\n  implements ParameterDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Parameter leftOasObject, OasObjectPropertyLocation rightLocation,\n    Parameter rightOasObject) {\n\n    if (ChangeRangeCheckUtils.isNotViolated(\n      defaultIfNull(leftOasObject.getAllowReserved(), Boolean.FALSE),\n      defaultIfNull(rightOasObject.getAllowReserved(), Boolean.FALSE),\n      singletonList(new Object[] { false, true }))) {\n      return emptyList();\n    }\n\n    String message = new StringBuilder()\n      .append(ParameterUtils.getKeyString(rightOasObject))\n      .append(':')\n      .append(DiffViolationMessages.FALSE_TO_TRUE)\n      .toString();\n\n    return singletonList(new OasDiffViolation(\n      leftLocation.property(\"allowReserved\"),\n      rightLocation.property(\"allowReserved\"),\n      message\n    ));\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/ParameterExplodeNotSameDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ParameterUtils;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\nimport java.util.Objects;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\npublic class ParameterExplodeNotSameDiffValidator\n  extends OasObjectDiffValidatorTemplate<Parameter>\n  implements ParameterDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Parameter leftOasObject, OasObjectPropertyLocation rightLocation,\n    Parameter rightOasObject) {\n\n    if (Objects.equals(leftOasObject.getExplode(), rightOasObject.getExplode())) {\n      return emptyList();\n    }\n\n    String message = new StringBuilder()\n      .append(ParameterUtils.getKeyString(rightOasObject))\n      .append(':')\n      .append(DiffViolationMessages.NEW_NOT_EQ_OLD)\n      .toString();\n\n    return singletonList(new OasDiffViolation(\n      leftLocation.property(\"explode\"),\n      rightLocation.property(\"explode\"),\n      message\n    ));\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/ParameterRequiredChangeDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasObjectDiffValidatorTemplate;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ParameterUtils;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.apache.commons.lang3.ObjectUtils.defaultIfNull;\n\n/**\n * Parameter.required only allow change true-&gt;false\n */\npublic class ParameterRequiredChangeDiffValidator\n  extends OasObjectDiffValidatorTemplate<Parameter>\n  implements ParameterDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Parameter leftOasObject, OasObjectPropertyLocation rightLocation,\n    Parameter rightOasObject) {\n\n    if (ChangeRangeCheckUtils.isNotViolated(\n      defaultIfNull(leftOasObject.getRequired(), Boolean.FALSE),\n      defaultIfNull(rightOasObject.getRequired(), Boolean.FALSE),\n      singletonList(new Object[] { true, false }))) {\n      return emptyList();\n    }\n\n    String message = new StringBuilder()\n      .append(ParameterUtils.getKeyString(rightOasObject))\n      .append(':')\n      .append(DiffViolationMessages.TRUE_TO_FALSE)\n      .toString();\n\n    return singletonList(new OasDiffViolation(\n      leftLocation.property(\"required\"),\n      rightLocation.property(\"required\"),\n      message\n    ));\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/ParameterStyleNotSameDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ParameterUtils;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\nimport java.util.Objects;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\npublic class ParameterStyleNotSameDiffValidator\n  extends OasObjectDiffValidatorTemplate<Parameter>\n  implements ParameterDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Parameter leftOasObject, OasObjectPropertyLocation rightLocation,\n    Parameter rightOasObject) {\n\n    if (Objects.equals(leftOasObject.getStyle(), rightOasObject.getStyle())) {\n      return emptyList();\n    }\n\n    String message = new StringBuilder()\n      .append(ParameterUtils.getKeyString(rightOasObject))\n      .append(':')\n      .append(DiffViolationMessages.NEW_NOT_EQ_OLD)\n      .toString();\n\n    return singletonList(new OasDiffViolation(\n      leftLocation.property(\"style\"),\n      rightLocation.property(\"style\"),\n      message\n    ));\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/pathitem/PathItemDeleteNotAllowedDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.pathitem;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.PathItem;\n\nimport java.util.List;\n\nimport static java.util.Collections.singletonList;\n\npublic class PathItemDeleteNotAllowedDiffValidator\n  extends OasObjectDiffValidatorTemplate<PathItem>\n  implements PathItemDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateDel(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    PathItem leftOasObject) {\n\n    return singletonList(OasDiffViolation.onlyLeft(leftLocation, DiffViolationMessages.OP_DEL_FORBIDDEN));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/requestbody/RequestBodyRequiredChangeDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.requestbody;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasObjectDiffValidatorTemplate;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.RequestBodyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport io.swagger.v3.oas.models.parameters.RequestBody;\nimport org.apache.commons.lang3.ObjectUtils;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\n/**\n * RequestBody.required only allow change true-&gt;false\n */\npublic class RequestBodyRequiredChangeDiffValidator\n  extends OasObjectDiffValidatorTemplate<RequestBody>\n  implements RequestBodyDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, RequestBody leftOasObject, OasObjectPropertyLocation rightLocation,\n    RequestBody rightOasObject) {\n\n    if (ChangeRangeCheckUtils.isNotViolated(\n      ObjectUtils.defaultIfNull(leftOasObject.getRequired(), Boolean.FALSE),\n      ObjectUtils.defaultIfNull(rightOasObject.getRequired(), Boolean.FALSE),\n      singletonList(new Object[] { true, false }))) {\n      return emptyList();\n    }\n\n    return singletonList(new OasDiffViolation(\n      leftLocation.property(\"required\"),\n      rightLocation.property(\"required\"),\n      DiffViolationMessages.TRUE_TO_FALSE\n    ));\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/response/ResponseAddNotAllowedDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.response;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.responses.ApiResponse;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation.onlyRight;\nimport static java.util.Collections.singletonList;\n\n/**\n * Adding Response Object under responses.'http status code' is not allowed\n */\npublic class ResponseAddNotAllowedDiffValidator\n  extends OasObjectDiffValidatorTemplate<ApiResponse>\n  implements ResponseDiffValidator {\n\n  @Override\n  protected List<OasDiffViolation> validateAdd(OasDiffValidationContext context,\n    OasObjectPropertyLocation rightLocation, ApiResponse rightOasObject) {\n    return singletonList(onlyRight(rightLocation, DiffViolationMessages.OP_ADD_FORBIDDEN));\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/SchemaDiscriminatorChangeValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport io.swagger.v3.oas.models.media.Discriminator;\nimport io.swagger.v3.oas.models.media.Schema;\n\npublic class SchemaDiscriminatorChangeValidator extends SchemaPropertyChangeValidator<Discriminator> {\n\n  @Override\n  protected Discriminator getProperty(Schema schema) {\n    return schema.getDiscriminator();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"discriminator\";\n  }\n\n  @Override\n  protected boolean isAllowed(Discriminator leftProperty, Discriminator rightProperty) {\n    return leftProperty.equals(rightProperty);\n  }\n\n  @Override\n  protected String getMessage(Discriminator leftProperty, Discriminator rightProperty) {\n    return DiffViolationMessages.NEW_NOT_EQ_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return true;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/SchemaPropertyChangeValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.util.List;\nimport java.util.Objects;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\npublic abstract class SchemaPropertyChangeValidator<T> implements SchemaCompareValidator {\n\n  @Override\n  public final List<OasDiffViolation> validate(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    Schema leftOasObject, OasObjectPropertyLocation rightLocation, Schema rightOasObject) {\n\n    if (!needValidate(context)) {\n      return emptyList();\n    }\n\n    T leftNumber = getProperty(leftOasObject);\n    T rightNumber = getProperty(rightOasObject);\n\n    if (Objects.equals(leftNumber, rightNumber)) {\n      return emptyList();\n    }\n\n    String propertyName = getPropertyName();\n\n    if (leftNumber == null || rightNumber == null) {\n      return singletonList(new OasDiffViolation(\n          leftLocation.property(propertyName),\n          rightLocation.property(propertyName),\n          getMessage(leftNumber, rightNumber)\n        )\n      );\n    }\n\n    if (!isAllowed(leftNumber, rightNumber)) {\n      return singletonList(new OasDiffViolation(\n          leftLocation.property(propertyName),\n          rightLocation.property(propertyName),\n          getMessage(leftNumber, rightNumber)\n        )\n      );\n    }\n\n    return emptyList();\n\n  }\n\n\n  protected abstract T getProperty(Schema schema);\n\n  protected abstract String getPropertyName();\n\n  protected abstract String getMessage(T leftProperty, T rightProperty);\n\n  protected abstract boolean isAllowed(T leftProperty, T rightProperty);\n\n  protected abstract boolean needValidate(OasDiffValidationContext context);\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/SchemaReadOnlyChangeValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.ObjectUtils;\n\npublic class SchemaReadOnlyChangeValidator extends SchemaPropertyChangeValidator<Boolean> {\n\n  @Override\n  protected Boolean getProperty(Schema schema) {\n    return ObjectUtils.defaultIfNull(schema.getReadOnly(), Boolean.FALSE);\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"readOnly\";\n  }\n\n  @Override\n  protected boolean isAllowed(Boolean leftProperty, Boolean rightProperty) {\n    return leftProperty.equals(rightProperty);\n  }\n\n  @Override\n  protected String getMessage(Boolean leftProperty, Boolean rightProperty) {\n    return DiffViolationMessages.NEW_NOT_EQ_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return true;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/SchemaTypeFormatChangeValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\npublic abstract class SchemaTypeFormatChangeValidator implements SchemaCompareValidator {\n\n  @Override\n  public final List<OasDiffViolation> validate(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    Schema leftOasObject, OasObjectPropertyLocation rightLocation, Schema rightOasObject) {\n\n    if (!needValidate(context)) {\n      return emptyList();\n    }\n\n    TypeFormat leftTypeFormat = new TypeFormat(leftOasObject);\n    TypeFormat rightTypeFormat = new TypeFormat(rightOasObject);\n\n    if (ChangeRangeCheckUtils.isNotViolated(leftTypeFormat, rightTypeFormat, getAllowedChangedList())) {\n      return emptyList();\n    }\n\n    StringBuilder message = new StringBuilder(\"the change \");\n    message\n      .append(\"(type=\")\n      .append(leftTypeFormat.getType())\n      .append(\",format=\")\n      .append(leftTypeFormat.getFormat())\n      .append(')')\n      .append(\"->\")\n      .append(\"(type=\")\n      .append(rightTypeFormat.getType())\n      .append(\",format=\")\n      .append(rightTypeFormat.getFormat())\n      .append(')')\n      .append(\" is not allowed\");\n\n    return singletonList(new OasDiffViolation(leftLocation, rightLocation, message.toString()));\n\n  }\n\n  protected abstract List<Object[]> getAllowedChangedList();\n\n  protected abstract boolean needValidate(OasDiffValidationContext context);\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/SchemaWriteOnlyChangeValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.ObjectUtils;\n\npublic class SchemaWriteOnlyChangeValidator extends SchemaPropertyChangeValidator<Boolean> {\n\n  @Override\n  protected Boolean getProperty(Schema schema) {\n    return ObjectUtils.defaultIfNull(schema.getWriteOnly(), Boolean.FALSE);\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"writeOnly\";\n  }\n\n  @Override\n  protected boolean isAllowed(Boolean leftProperty, Boolean rightProperty) {\n    return leftProperty.equals(rightProperty);\n  }\n\n  @Override\n  protected String getMessage(Boolean leftProperty, Boolean rightProperty) {\n    return DiffViolationMessages.NEW_NOT_EQ_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return true;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/SchemaXmlChangeValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport io.swagger.v3.oas.models.media.Schema;\nimport io.swagger.v3.oas.models.media.XML;\n\npublic class SchemaXmlChangeValidator extends SchemaPropertyChangeValidator<XML> {\n\n  @Override\n  protected XML getProperty(Schema schema) {\n    return schema.getXml();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"xml\";\n  }\n\n  @Override\n  protected boolean isAllowed(XML leftProperty, XML rightProperty) {\n    return leftProperty.equals(rightProperty);\n  }\n\n  @Override\n  protected String getMessage(XML leftProperty, XML rightProperty) {\n    return DiffViolationMessages.NEW_NOT_EQ_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return true;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/TypeFormat.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema;\n\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.util.Objects;\nimport java.util.StringJoiner;\n\npublic class TypeFormat {\n  private final String type;\n  private final String format;\n\n  public TypeFormat(String type, String format) {\n    this.type = type;\n    this.format = format;\n  }\n\n  public TypeFormat(Schema schema) {\n    this.type = schema.getType();\n    this.format = schema.getFormat();\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    TypeFormat that = (TypeFormat) o;\n    return Objects.equals(type, that.type) &&\n      Objects.equals(format, that.format);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(type, format);\n  }\n\n  @Override\n  public String toString() {\n    return new StringJoiner(\", \", TypeFormat.class.getSimpleName() + \"[\", \"]\")\n      .add(\"type='\" + type + \"'\")\n      .add(\"format='\" + format + \"'\")\n      .toString();\n  }\n\n  public String getType() {\n    return type;\n  }\n\n  public String getFormat() {\n    return format;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaEnumChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.ObjectUtils;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\nimport static java.util.Collections.emptyList;\n\npublic class SchemaEnumChangeInRequestValidator extends SchemaPropertyChangeValidator<List> {\n\n  public static final String VIOLATION_MESSAGE = \"deleting enum on right side is not allowed\";\n\n  @Override\n  protected List getProperty(Schema schema) {\n    return ObjectUtils.defaultIfNull(schema.getEnum(), emptyList());\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"enum\";\n  }\n\n  @Override\n  protected boolean isAllowed(List leftProperty, List rightProperty) {\n    return rightProperty.containsAll(leftProperty);\n  }\n\n  @Override\n  protected String getMessage(List leftProperty, List rightProperty) {\n    return VIOLATION_MESSAGE;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaExclusiveMaximumChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.ObjectUtils;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\nimport static java.util.Collections.singletonList;\n\npublic class SchemaExclusiveMaximumChangeInRequestValidator extends SchemaPropertyChangeValidator<Boolean> {\n\n  @Override\n  protected Boolean getProperty(Schema schema) {\n    return ObjectUtils.defaultIfNull(schema.getExclusiveMaximum(), Boolean.FALSE);\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"exclusiveMaximum\";\n  }\n\n  @Override\n  protected boolean isAllowed(Boolean leftProperty, Boolean rightProperty) {\n\n    return ChangeRangeCheckUtils\n      .isNotViolated(leftProperty, rightProperty, singletonList(new Object[] { true, false }));\n\n  }\n\n  @Override\n  protected String getMessage(Boolean leftProperty, Boolean rightProperty) {\n    return DiffViolationMessages.TRUE_TO_FALSE;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaExclusiveMinimumChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.ObjectUtils;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\nimport static java.util.Collections.singletonList;\n\npublic class SchemaExclusiveMinimumChangeInRequestValidator extends SchemaPropertyChangeValidator<Boolean> {\n\n  @Override\n  protected Boolean getProperty(Schema schema) {\n    return ObjectUtils.defaultIfNull(schema.getExclusiveMinimum(), Boolean.FALSE);\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"exclusiveMinimum\";\n  }\n\n  @Override\n  protected boolean isAllowed(Boolean leftProperty, Boolean rightProperty) {\n    return ChangeRangeCheckUtils\n      .isNotViolated(leftProperty, rightProperty, singletonList(new Object[] { true, false }));\n  }\n\n  @Override\n  protected String getMessage(Boolean leftProperty, Boolean rightProperty) {\n    return DiffViolationMessages.TRUE_TO_FALSE;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMaxItemsChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\n\npublic class SchemaMaxItemsChangeInRequestValidator extends SchemaPropertyChangeValidator<Integer> {\n\n  @Override\n  protected Integer getProperty(Schema schema) {\n    return schema.getMaxItems();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"maxItems\";\n  }\n\n  @Override\n  protected boolean isAllowed(Integer leftProperty, Integer rightProperty) {\n    return rightProperty.compareTo(leftProperty) >= 0;\n  }\n\n  @Override\n  protected String getMessage(Integer leftProperty, Integer rightProperty) {\n    return DiffViolationMessages.NEW_NOT_GTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMaxLengthChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\n\npublic class SchemaMaxLengthChangeInRequestValidator extends SchemaPropertyChangeValidator<Integer> {\n\n  @Override\n  protected Integer getProperty(Schema schema) {\n    return schema.getMaxLength();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"maxLength\";\n  }\n\n  @Override\n  protected boolean isAllowed(Integer leftProperty, Integer rightProperty) {\n    return rightProperty.compareTo(leftProperty) >= 0;\n  }\n\n  @Override\n  protected String getMessage(Integer leftProperty, Integer rightProperty) {\n    return DiffViolationMessages.NEW_NOT_GTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMaxPropertiesChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\n\npublic class SchemaMaxPropertiesChangeInRequestValidator extends SchemaPropertyChangeValidator<Integer> {\n\n  @Override\n  protected Integer getProperty(Schema schema) {\n    return schema.getMaxProperties();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"maxProperties\";\n  }\n\n  @Override\n  protected boolean isAllowed(Integer leftProperty, Integer rightProperty) {\n    return rightProperty.compareTo(leftProperty) >= 0;\n  }\n\n  @Override\n  protected String getMessage(Integer leftProperty, Integer rightProperty) {\n    return DiffViolationMessages.NEW_NOT_GTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMaximumChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.math.BigDecimal;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\n\npublic class SchemaMaximumChangeInRequestValidator extends SchemaPropertyChangeValidator<BigDecimal> {\n\n  @Override\n  protected BigDecimal getProperty(Schema schema) {\n    return schema.getMaximum();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"maximum\";\n  }\n\n  @Override\n  protected boolean isAllowed(BigDecimal leftProperty, BigDecimal rightProperty) {\n    return rightProperty.compareTo(leftProperty) >= 0;\n  }\n\n  @Override\n  protected String getMessage(BigDecimal leftProperty, BigDecimal rightProperty) {\n    return DiffViolationMessages.NEW_NOT_GTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMinItemsChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\n\npublic class SchemaMinItemsChangeInRequestValidator extends SchemaPropertyChangeValidator<Integer> {\n\n  @Override\n  protected Integer getProperty(Schema schema) {\n    return schema.getMinItems();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"minItems\";\n  }\n\n  @Override\n  protected boolean isAllowed(Integer leftProperty, Integer rightProperty) {\n    return rightProperty.compareTo(leftProperty) <= 0;\n  }\n\n  @Override\n  protected String getMessage(Integer leftProperty, Integer rightProperty) {\n    return DiffViolationMessages.NEW_NOT_LTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMinLengthChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\n\npublic class SchemaMinLengthChangeInRequestValidator extends SchemaPropertyChangeValidator<Integer> {\n\n  @Override\n  protected Integer getProperty(Schema schema) {\n    return schema.getMinLength();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"minLength\";\n  }\n\n  @Override\n  protected boolean isAllowed(Integer leftProperty, Integer rightProperty) {\n    return rightProperty.compareTo(leftProperty) <= 0;\n  }\n\n  @Override\n  protected String getMessage(Integer leftProperty, Integer rightProperty) {\n    return DiffViolationMessages.NEW_NOT_LTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMinPropertiesChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\n\npublic class SchemaMinPropertiesChangeInRequestValidator extends SchemaPropertyChangeValidator<Integer> {\n\n  @Override\n  protected Integer getProperty(Schema schema) {\n    return schema.getMinProperties();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"minProperties\";\n  }\n\n  @Override\n  protected boolean isAllowed(Integer leftProperty, Integer rightProperty) {\n    return rightProperty.compareTo(leftProperty) <= 0;\n  }\n\n  @Override\n  protected String getMessage(Integer leftProperty, Integer rightProperty) {\n    return DiffViolationMessages.NEW_NOT_LTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMinimumChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.math.BigDecimal;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\n\npublic class SchemaMinimumChangeInRequestValidator extends SchemaPropertyChangeValidator<BigDecimal> {\n\n  @Override\n  protected BigDecimal getProperty(Schema schema) {\n    return schema.getMinimum();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"minimum\";\n  }\n\n  @Override\n  protected boolean isAllowed(BigDecimal leftProperty, BigDecimal rightProperty) {\n    return rightProperty.compareTo(leftProperty) <= 0;\n  }\n\n  @Override\n  protected String getMessage(BigDecimal leftProperty, BigDecimal rightProperty) {\n    return DiffViolationMessages.NEW_NOT_LTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMultipleOfChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.math.BigDecimal;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\n\npublic class SchemaMultipleOfChangeInRequestValidator extends SchemaPropertyChangeValidator<BigDecimal> {\n\n  public static final String VIOLATION_MESSAGE = \"right value is neither equal to left value nor a factor of left value\";\n\n  @Override\n  protected BigDecimal getProperty(Schema schema) {\n    return schema.getMultipleOf();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"multipleOf\";\n  }\n\n  @Override\n  protected String getMessage(BigDecimal leftProperty, BigDecimal rightProperty) {\n    return VIOLATION_MESSAGE;\n  }\n\n  @Override\n  protected boolean isAllowed(BigDecimal leftProperty, BigDecimal rightProperty) {\n    return BigDecimal.ZERO.compareTo(leftProperty.divideAndRemainder(rightProperty)[1]) == 0;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaNullableChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.ObjectUtils;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\nimport static java.util.Collections.singletonList;\n\npublic class SchemaNullableChangeInRequestValidator extends SchemaPropertyChangeValidator<Boolean> {\n\n  @Override\n  protected Boolean getProperty(Schema schema) {\n    return ObjectUtils.defaultIfNull(schema.getNullable(), Boolean.FALSE);\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"nullable\";\n  }\n\n  @Override\n  protected boolean isAllowed(Boolean leftProperty, Boolean rightProperty) {\n    return ChangeRangeCheckUtils\n      .isNotViolated(leftProperty, rightProperty, singletonList(new Object[] { false, true }));\n  }\n\n  @Override\n  protected String getMessage(Boolean leftProperty, Boolean rightProperty) {\n    return DiffViolationMessages.FALSE_TO_TRUE;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaRequiredChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.ObjectUtils;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\nimport static java.util.Collections.emptyList;\n\npublic class SchemaRequiredChangeInRequestValidator extends SchemaPropertyChangeValidator<List<String>> {\n\n  public static final String VIOLATION_MESSAGE = \"adding required fields is not allowed on right side\";\n\n  @Override\n  protected List<String> getProperty(Schema schema) {\n    return ObjectUtils.defaultIfNull(schema.getRequired(), emptyList());\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"required\";\n  }\n\n  @Override\n  protected boolean isAllowed(List<String> leftProperty, List<String> rightProperty) {\n    return leftProperty.containsAll(rightProperty);\n  }\n\n  @Override\n  protected String getMessage(List<String> leftProperty, List<String> rightProperty) {\n    return VIOLATION_MESSAGE;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaTypeFormatChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaTypeFormatChangeValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.TypeFormat;\n\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\n\npublic class SchemaTypeFormatChangeInRequestValidator extends SchemaTypeFormatChangeValidator {\n\n  private static final List<Object[]> allowedChangedList;\n\n  static {\n    Object[][] allowedChange = new Object[][] {\n      new Object[] { new TypeFormat(\"integer\", null), new TypeFormat(\"integer\", \"int64\") },\n      new Object[] { new TypeFormat(\"integer\", null), new TypeFormat(\"number\", \"double\") },\n      new Object[] { new TypeFormat(\"integer\", null), new TypeFormat(\"number\", null) },\n\n      new Object[] { new TypeFormat(\"integer\", \"int32\"), new TypeFormat(\"integer\", \"int64\") },\n      new Object[] { new TypeFormat(\"integer\", \"int32\"), new TypeFormat(\"integer\", null) },\n      new Object[] { new TypeFormat(\"integer\", \"int32\"), new TypeFormat(\"number\", \"float\") },\n      new Object[] { new TypeFormat(\"integer\", \"int32\"), new TypeFormat(\"number\", \"double\") },\n      new Object[] { new TypeFormat(\"integer\", \"int32\"), new TypeFormat(\"number\", null) },\n\n      new Object[] { new TypeFormat(\"integer\", \"int64\"), new TypeFormat(\"integer\", null) },\n      new Object[] { new TypeFormat(\"integer\", \"int64\"), new TypeFormat(\"number\", \"double\") },\n      new Object[] { new TypeFormat(\"integer\", \"int64\"), new TypeFormat(\"number\", null) },\n\n      new Object[] { new TypeFormat(\"number\", null), new TypeFormat(\"number\", \"double\") },\n\n      new Object[] { new TypeFormat(\"number\", \"float\"), new TypeFormat(\"number\", null) },\n      new Object[] { new TypeFormat(\"number\", \"float\"), new TypeFormat(\"number\", \"double\") },\n\n      new Object[] { new TypeFormat(\"number\", \"double\"), new TypeFormat(\"number\", null) },\n\n      new Object[] { new TypeFormat(\"string\", null), new TypeFormat(\"string\", \"password\") },\n\n      new Object[] { new TypeFormat(\"string\", \"password\"), new TypeFormat(\"string\", null) },\n    };\n    allowedChangedList = Collections.unmodifiableList(Arrays.asList(allowedChange));\n  }\n\n  @Override\n  protected List<Object[]> getAllowedChangedList() {\n    return allowedChangedList;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInRequestBody(context) || isInParameter(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaUniqueItemsChangeInRequestValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInParameter;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInRequestBody;\nimport static java.util.Collections.singletonList;\n\npublic class SchemaUniqueItemsChangeInRequestValidator extends SchemaPropertyChangeValidator<Boolean> {\n\n  @Override\n  protected Boolean getProperty(Schema schema) {\n    return schema.getUniqueItems();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"uniqueItems\";\n  }\n\n  @Override\n  protected boolean isAllowed(Boolean leftProperty, Boolean rightProperty) {\n    return ChangeRangeCheckUtils\n      .isNotViolated(leftProperty, rightProperty, singletonList(new Object[] { true, false }));\n  }\n\n  @Override\n  protected String getMessage(Boolean leftProperty, Boolean rightProperty) {\n    return DiffViolationMessages.TRUE_TO_FALSE;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInParameter(context) || isInRequestBody(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaEnumChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.ObjectUtils;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\nimport static java.util.Collections.emptyList;\n\npublic class SchemaEnumChangeInResponseValidator extends SchemaPropertyChangeValidator<List> {\n\n  public static final String VIOLATION_MESSAGE = \"adding enum on right side is not allowed\";\n\n  @Override\n  protected List getProperty(Schema schema) {\n    return ObjectUtils.defaultIfNull(schema.getEnum(), emptyList());\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"enum\";\n  }\n\n  @Override\n  protected boolean isAllowed(List leftProperty, List rightProperty) {\n    return leftProperty.containsAll(rightProperty);\n  }\n\n  @Override\n  protected String getMessage(List leftProperty, List rightProperty) {\n    return VIOLATION_MESSAGE;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaExclusiveMaximumChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.ObjectUtils;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\nimport static java.util.Collections.singletonList;\n\npublic class SchemaExclusiveMaximumChangeInResponseValidator extends SchemaPropertyChangeValidator<Boolean> {\n\n  @Override\n  protected Boolean getProperty(Schema schema) {\n    return ObjectUtils.defaultIfNull(schema.getExclusiveMaximum(), Boolean.FALSE);\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"exclusiveMaximum\";\n  }\n\n  @Override\n  protected boolean isAllowed(Boolean leftProperty, Boolean rightProperty) {\n\n    return ChangeRangeCheckUtils\n      .isNotViolated(leftProperty, rightProperty, singletonList(new Object[] { false, true }));\n\n  }\n\n  @Override\n  protected String getMessage(Boolean leftProperty, Boolean rightProperty) {\n    return DiffViolationMessages.FALSE_TO_TRUE;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaExclusiveMinimumChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.ObjectUtils;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\nimport static java.util.Collections.singletonList;\n\npublic class SchemaExclusiveMinimumChangeInResponseValidator extends SchemaPropertyChangeValidator<Boolean> {\n\n  @Override\n  protected Boolean getProperty(Schema schema) {\n    return ObjectUtils.defaultIfNull(schema.getExclusiveMinimum(), Boolean.FALSE);\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"exclusiveMinimum\";\n  }\n\n  @Override\n  protected boolean isAllowed(Boolean leftProperty, Boolean rightProperty) {\n\n    return ChangeRangeCheckUtils\n      .isNotViolated(leftProperty, rightProperty, singletonList(new Object[] { false, true }));\n\n  }\n\n  @Override\n  protected String getMessage(Boolean leftProperty, Boolean rightProperty) {\n    return DiffViolationMessages.FALSE_TO_TRUE;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMaxItemsChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.*;\n\npublic class SchemaMaxItemsChangeInResponseValidator extends SchemaPropertyChangeValidator<Integer> {\n\n  @Override\n  protected Integer getProperty(Schema schema) {\n    return schema.getMaxItems();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"maxItems\";\n  }\n\n  @Override\n  protected boolean isAllowed(Integer leftProperty, Integer rightProperty) {\n    return rightProperty.compareTo(leftProperty) <= 0;\n  }\n\n  @Override\n  protected String getMessage(Integer leftProperty, Integer rightProperty) {\n    return DiffViolationMessages.NEW_NOT_LTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMaxLengthChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.*;\n\npublic class SchemaMaxLengthChangeInResponseValidator extends SchemaPropertyChangeValidator<Integer> {\n\n  @Override\n  protected Integer getProperty(Schema schema) {\n    return schema.getMaxLength();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"maxLength\";\n  }\n\n  @Override\n  protected boolean isAllowed(Integer leftProperty, Integer rightProperty) {\n    return rightProperty.compareTo(leftProperty) <= 0;\n  }\n\n  @Override\n  protected String getMessage(Integer leftProperty, Integer rightProperty) {\n    return DiffViolationMessages.NEW_NOT_LTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMaxPropertiesChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\n\npublic class SchemaMaxPropertiesChangeInResponseValidator extends SchemaPropertyChangeValidator<Integer> {\n\n  @Override\n  protected Integer getProperty(Schema schema) {\n    return schema.getMaxProperties();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"maxProperties\";\n  }\n\n  @Override\n  protected boolean isAllowed(Integer leftProperty, Integer rightProperty) {\n    return rightProperty.compareTo(leftProperty) <= 0;\n  }\n\n  @Override\n  protected String getMessage(Integer leftProperty, Integer rightProperty) {\n    return DiffViolationMessages.NEW_NOT_LTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMaximumChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.math.BigDecimal;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\n\npublic class SchemaMaximumChangeInResponseValidator extends SchemaPropertyChangeValidator<BigDecimal> {\n\n  @Override\n  protected BigDecimal getProperty(Schema schema) {\n    return schema.getMaximum();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"maximum\";\n  }\n\n  @Override\n  protected boolean isAllowed(BigDecimal leftProperty, BigDecimal rightProperty) {\n    return rightProperty.compareTo(leftProperty) <= 0;\n  }\n\n  @Override\n  protected String getMessage(BigDecimal leftProperty, BigDecimal rightProperty) {\n    return DiffViolationMessages.NEW_NOT_LTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMinItemsChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\n\npublic class SchemaMinItemsChangeInResponseValidator extends SchemaPropertyChangeValidator<Integer> {\n\n  @Override\n  protected Integer getProperty(Schema schema) {\n    return schema.getMinItems();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"minItems\";\n  }\n\n  @Override\n  protected boolean isAllowed(Integer leftProperty, Integer rightProperty) {\n    return rightProperty.compareTo(leftProperty) >= 0;\n  }\n\n  @Override\n  protected String getMessage(Integer leftProperty, Integer rightProperty) {\n    return DiffViolationMessages.NEW_NOT_GTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMinLengthChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\n\npublic class SchemaMinLengthChangeInResponseValidator extends SchemaPropertyChangeValidator<Integer> {\n\n  @Override\n  protected Integer getProperty(Schema schema) {\n    return schema.getMinLength();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"minLength\";\n  }\n\n  @Override\n  protected boolean isAllowed(Integer leftProperty, Integer rightProperty) {\n    return rightProperty.compareTo(leftProperty) >= 0;\n  }\n\n  @Override\n  protected String getMessage(Integer leftProperty, Integer rightProperty) {\n    return DiffViolationMessages.NEW_NOT_GTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMinPropertiesChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\n\npublic class SchemaMinPropertiesChangeInResponseValidator extends SchemaPropertyChangeValidator<Integer> {\n\n  @Override\n  protected Integer getProperty(Schema schema) {\n    return schema.getMinProperties();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"minProperties\";\n  }\n\n  @Override\n  protected boolean isAllowed(Integer leftProperty, Integer rightProperty) {\n    return rightProperty.compareTo(leftProperty) >= 0;\n  }\n\n  @Override\n  protected String getMessage(Integer leftProperty, Integer rightProperty) {\n    return DiffViolationMessages.NEW_NOT_GTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMinimumChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.math.BigDecimal;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.*;\n\npublic class SchemaMinimumChangeInResponseValidator extends SchemaPropertyChangeValidator<BigDecimal> {\n\n  @Override\n  protected BigDecimal getProperty(Schema schema) {\n    return schema.getMinimum();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"minimum\";\n  }\n\n  @Override\n  protected boolean isAllowed(BigDecimal leftProperty, BigDecimal rightProperty) {\n    return rightProperty.compareTo(leftProperty) >= 0;\n  }\n\n  @Override\n  protected String getMessage(BigDecimal leftProperty, BigDecimal rightProperty) {\n    return DiffViolationMessages.NEW_NOT_GTE_OLD;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMultipleOfChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.math.BigDecimal;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\n\npublic class SchemaMultipleOfChangeInResponseValidator extends SchemaPropertyChangeValidator<BigDecimal> {\n\n  public static final String VIOLATION_MESSAGE = \"right value is neither equal to left value nor multiple of left value\";\n\n  @Override\n  protected BigDecimal getProperty(Schema schema) {\n    return schema.getMultipleOf();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"multipleOf\";\n  }\n\n  @Override\n  protected String getMessage(BigDecimal leftProperty, BigDecimal rightProperty) {\n    return VIOLATION_MESSAGE;\n  }\n\n  @Override\n  protected boolean isAllowed(BigDecimal leftProperty, BigDecimal rightProperty) {\n    return BigDecimal.ZERO.compareTo(rightProperty.divideAndRemainder(leftProperty)[1]) == 0;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaNullableChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.ObjectUtils;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\nimport static java.util.Collections.singletonList;\n\npublic class SchemaNullableChangeInResponseValidator extends SchemaPropertyChangeValidator<Boolean> {\n\n  @Override\n  protected Boolean getProperty(Schema schema) {\n    return ObjectUtils.defaultIfNull(schema.getNullable(), Boolean.FALSE);\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"nullable\";\n  }\n\n  @Override\n  protected boolean isAllowed(Boolean leftProperty, Boolean rightProperty) {\n    return ChangeRangeCheckUtils\n      .isNotViolated(leftProperty, rightProperty, singletonList(new Object[] { true, false }));\n  }\n\n  @Override\n  protected String getMessage(Boolean leftProperty, Boolean rightProperty) {\n    return DiffViolationMessages.TRUE_TO_FALSE;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaRequiredChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.ObjectUtils;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\nimport static java.util.Collections.emptyList;\n\npublic class SchemaRequiredChangeInResponseValidator extends SchemaPropertyChangeValidator<List<String>> {\n\n  public static final String VIOLATION_MESSAGE = \"deleting required fields is not allowed on right side\";\n\n  @Override\n  protected List<String> getProperty(Schema schema) {\n    return ObjectUtils.defaultIfNull(schema.getRequired(), emptyList());\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"required\";\n  }\n\n  @Override\n  protected boolean isAllowed(List<String> leftProperty, List<String> rightProperty) {\n    return rightProperty.containsAll(leftProperty);\n  }\n\n  @Override\n  protected String getMessage(List<String> leftProperty, List<String> rightProperty) {\n    return SchemaRequiredChangeInResponseValidator.VIOLATION_MESSAGE;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaTypeFormatChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaTypeFormatChangeValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.TypeFormat;\n\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\n\npublic class SchemaTypeFormatChangeInResponseValidator extends SchemaTypeFormatChangeValidator {\n\n  private static final List<Object[]> allowedChangedList;\n\n  static {\n    Object[][] allowedChange = new Object[][] {\n      new Object[] { new TypeFormat(\"integer\", null), new TypeFormat(\"integer\", \"int64\") },\n      new Object[] { new TypeFormat(\"integer\", null), new TypeFormat(\"integer\", \"int32\") },\n\n      new Object[] { new TypeFormat(\"integer\", \"int64\"), new TypeFormat(\"integer\", null) },\n      new Object[] { new TypeFormat(\"integer\", \"int64\"), new TypeFormat(\"integer\", \"int32\") },\n\n      new Object[] { new TypeFormat(\"number\", null), new TypeFormat(\"number\", \"double\") },\n      new Object[] { new TypeFormat(\"number\", null), new TypeFormat(\"number\", \"float\") },\n\n      new Object[] { new TypeFormat(\"number\", \"double\"), new TypeFormat(\"number\", null) },\n      new Object[] { new TypeFormat(\"number\", \"double\"), new TypeFormat(\"number\", \"float\") },\n\n      new Object[] { new TypeFormat(\"string\", null), new TypeFormat(\"string\", \"password\") },\n\n      new Object[] { new TypeFormat(\"string\", \"password\"), new TypeFormat(\"string\", null) },\n    };\n    allowedChangedList = Collections.unmodifiableList(Arrays.asList(allowedChange));\n  }\n\n  @Override\n  protected List<Object[]> getAllowedChangedList() {\n    return allowedChangedList;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaUniqueItemsChangeInResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.ChangeRangeCheckUtils;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaPropertyChangeValidator;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.isInResponse;\nimport static java.util.Collections.singletonList;\n\npublic class SchemaUniqueItemsChangeInResponseValidator extends SchemaPropertyChangeValidator<Boolean> {\n\n  @Override\n  protected Boolean getProperty(Schema schema) {\n    return schema.getUniqueItems();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"uniqueItems\";\n  }\n\n  @Override\n  protected boolean isAllowed(Boolean leftProperty, Boolean rightProperty) {\n    return ChangeRangeCheckUtils\n      .isNotViolated(leftProperty, rightProperty, singletonList(new Object[] { false, true }));\n  }\n\n  @Override\n  protected String getMessage(Boolean leftProperty, Boolean rightProperty) {\n    return DiffViolationMessages.FALSE_TO_TRUE;\n  }\n\n  @Override\n  protected boolean needValidate(OasDiffValidationContext context) {\n    return isInResponse(context);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/CompatibilityCheckParserTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility;\n\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport org.junit.Test;\n\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\nimport io.swagger.v3.parser.util.ClasspathHelper;\n\npublic class CompatibilityCheckParserTest {\n\n  @Test\n  public void parseYaml() {\n    String yaml = loadRelative(\"parser-test.yaml\");\n    SwaggerParseResult swaggerParseResult = CompatibilityCheckParser.parseYaml(yaml);\n    assertThat(swaggerParseResult).isNotNull();\n    assertThat(swaggerParseResult.getOpenAPI()).isNotNull();\n    assertThat(swaggerParseResult.getMessages()).isEmpty();\n  }\n\n  private String loadRelative(String filename) {\n    String basePath = getClass().getPackage().getName().replaceAll(\"\\\\.\", \"/\");\n    return ClasspathHelper.loadFileFromClasspath(basePath + \"/\" + filename);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultCallbackDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.CallbackDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultCallbackDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultCallbackDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<CallbackDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).isEmpty();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultComponentsDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ComponentsDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultComponentsDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultComponentsDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<ComponentsDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).hasSize(6);\n  }\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultEncodingDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultEncodingDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultEncodingDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<EncodingDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).hasSize(7);\n  }\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultInfoDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.InfoDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultInfoDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultInfoDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<InfoDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).isEmpty();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultLinkDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.LinkDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultLinkDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultLinkDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<LinkDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).isEmpty();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultMediaTypeDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MediaTypeDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultMediaTypeDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultMediaTypeDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<MediaTypeDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).hasSize(6);\n  }\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultOasSpecDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultOasSpecDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultOasSpecDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    assertThat(validatorFactory.create()).isNotNull();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultOpenApiDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OpenApiDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultOpenApiDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultOpenApiDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<OpenApiDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).hasSize(5);\n  }\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultOperationDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OperationDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultOperationDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultOperationDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<OperationDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).hasSize(5);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultParameterDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultParameterDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultParameterDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<ParameterDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).hasSize(8);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultPathItemDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.PathItemDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultPathItemDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultPathItemDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<PathItemDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).hasSize(3);\n  }\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultPathsDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.PathsDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultPathsDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultPathsDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<PathsDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).hasSize(1);\n  }\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultRequestBodyDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.RequestBodyDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultRequestBodyDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultRequestBodyDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<RequestBodyDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).hasSize(2);\n  }\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultResponseDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ResponseDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultResponseDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultResponseDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<ResponseDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).hasSize(3);\n  }\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultResponsesDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ResponsesDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultResponsesDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultResponsesDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<ResponsesDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).hasSize(1);\n  }\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultSchemaDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultSchemaDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultSchemaDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<SchemaDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).hasSize(1);\n  }\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultSecuritySchemeDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SecuritySchemeDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultSecuritySchemeDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultSecuritySchemeDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<SecuritySchemeDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).isEmpty();\n  }\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultServerDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ServerDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultServerDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultServerDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<ServerDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).isEmpty();\n  }\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DefaultTagDiffValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.TagDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = DiffValidatorFactoryTestConfiguration.class)\npublic class DefaultTagDiffValidatorFactoryTest {\n\n  @Autowired\n  private DefaultTagDiffValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    List<TagDiffValidator> validators = validatorFactory.create();\n    assertThat(validators).isEmpty();\n  }\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/factory/DiffValidatorFactoryTestConfiguration.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.factory;\n\nimport org.springframework.context.annotation.ComponentScan;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\n@ComponentScan\nclass DiffValidatorFactoryTestConfiguration {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/OasCompatibilityTestBase.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.CompatibilityCheckParser;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.test.OasDiffValidatorTestBase;\n\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\nimport io.swagger.v3.parser.util.ClasspathHelper;\n\npublic class OasCompatibilityTestBase extends OasDiffValidatorTestBase {\n\n  @Override\n  protected SwaggerParseResult parseAbsolute(String classpath) {\n    String content = ClasspathHelper.loadFileFromClasspath(classpath);\n    return CompatibilityCheckParser.parseYaml(content);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/EncodingAddNotAllowedDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = EncodingAddNotAllowedDiffValidatorTest.TestConfiguration.class)\npublic class EncodingAddNotAllowedDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-encoding-add-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-encoding-add-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationRight(\n          DiffViolationMessages.OP_ADD_FORBIDDEN,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/x-www-form-urlencoded'\", MEDIA_TYPE,\n            \"encoding.'bar'\", ENCODING\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public EncodingDiffValidator encodingAddNotAllowedDiffValidator() {\n\n      return new EncodingAddNotAllowedDiffValidator();\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/EncodingAllowedReservedChangeDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = EncodingAllowedReservedChangeDiffValidatorTest.TestConfiguration.class)\npublic class EncodingAllowedReservedChangeDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-encoding-allow-reserved-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-encoding-allow-reserved-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(\n          DiffViolationMessages.FALSE_TO_TRUE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/x-www-form-urlencoded'\", MEDIA_TYPE,\n            \"encoding.'foo'\", ENCODING,\n            \"allowReserved\", null\n          },\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/x-www-form-urlencoded'\", MEDIA_TYPE,\n            \"encoding.'foo'\", ENCODING,\n            \"allowReserved\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public EncodingDiffValidator encodingAllowedReservedChangeDiffValidator() {\n\n      return new EncodingAllowedReservedChangeDiffValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/EncodingContentTypeNotSameDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = EncodingContentTypeNotSameDiffValidatorTest.TestConfiguration.class)\npublic class EncodingContentTypeNotSameDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-encoding-content-type-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-encoding-content-type-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/x-www-form-urlencoded'\", MEDIA_TYPE,\n            \"encoding.'foo'\", ENCODING,\n            \"contentType\", null\n          },\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/x-www-form-urlencoded'\", MEDIA_TYPE,\n            \"encoding.'foo'\", ENCODING,\n            \"contentType\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public EncodingDiffValidator encodingContentTypeNotSameDiffValidator() {\n\n      return new EncodingContentTypeNotSameDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/EncodingDelNotAllowedDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = EncodingDelNotAllowedDiffValidatorTest.TestConfiguration.class)\npublic class EncodingDelNotAllowedDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-encoding-del-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-encoding-del-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationLeft(\n          DiffViolationMessages.OP_DEL_FORBIDDEN,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/x-www-form-urlencoded'\", MEDIA_TYPE,\n            \"encoding.'bar'\", ENCODING\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public EncodingDiffValidator encodingDelNotAllowedDiffValidator() {\n\n      return new EncodingDelNotAllowedDiffValidator();\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/EncodingExplodeNotSameDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = EncodingExplodeNotSameDiffValidatorTest.TestConfiguration.class)\npublic class EncodingExplodeNotSameDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-encoding-explode-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-encoding-explode-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/x-www-form-urlencoded'\", MEDIA_TYPE,\n            \"encoding.'foo'\", ENCODING,\n            \"explode\", null\n          },\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/x-www-form-urlencoded'\", MEDIA_TYPE,\n            \"encoding.'foo'\", ENCODING,\n            \"explode\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public EncodingDiffValidator encodingExplodeNotSameDiffValidator() {\n\n      return new EncodingExplodeNotSameDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/EncodingStyleNotSameDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = EncodingStyleNotSameDiffValidatorTest.TestConfiguration.class)\npublic class EncodingStyleNotSameDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-encoding-style-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-encoding-style-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/x-www-form-urlencoded'\", MEDIA_TYPE,\n            \"encoding.'foo'\", ENCODING,\n            \"style\", null\n          },\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/x-www-form-urlencoded'\", MEDIA_TYPE,\n            \"encoding.'foo'\", ENCODING,\n            \"style\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public EncodingDiffValidator encodingStyleNotSameDiffValidator() {\n\n      return new EncodingStyleNotSameDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/header/HeaderAddInRequestBodyNotAllowedDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.header;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.HeaderDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = HeaderAddInRequestBodyNotAllowedDiffValidatorTest.TestConfiguration.class)\npublic class HeaderAddInRequestBodyNotAllowedDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-header-add-in-request-body-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-header-add-in-request-body-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationRight(\n          DiffViolationMessages.OP_ADD_FORBIDDEN,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/x-www-form-urlencoded'\", MEDIA_TYPE,\n            \"encoding.'foo'\", ENCODING,\n            \"headers.'X-Foo'\", HEADER\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public HeaderDiffValidator headerAddInRequestBodyNotAllowed() {\n\n      return new HeaderAddInRequestBodyNotAllowedDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/header/HeaderDelInResponseNotAllowedDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.header;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.HeaderDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = HeaderDelInResponseNotAllowedDiffValidatorTest.TestConfiguration.class)\npublic class HeaderDelInResponseNotAllowedDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-header-del-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-header-del-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationLeft(\n          DiffViolationMessages.OP_DEL_FORBIDDEN,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"headers.'X-Bar'\", HEADER\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public HeaderDiffValidator headerDelInResponseNotAllowed() {\n\n      return new HeaderDelInResponseNotAllowedDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/MediaTypeAddInParameterNotAllowedDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MediaTypeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = MediaTypeAddInParameterNotAllowedDiffValidatorTest.TestConfiguration.class)\npublic class MediaTypeAddInParameterNotAllowedDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-media-type-add-in-parameter-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-media-type-add-in-parameter-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationRight(\n          DiffViolationMessages.OP_ADD_FORBIDDEN,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"content.'application/json'\", MEDIA_TYPE\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public MediaTypeDiffValidator mediaTypeAddInParameterNotAllowedDiffValidator() {\n\n      return new MediaTypeAddInParameterNotAllowedDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/MediaTypeDelInParameterNotAllowedDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MediaTypeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = MediaTypeDelInParameterNotAllowedDiffValidatorTest.TestConfiguration.class)\npublic class MediaTypeDelInParameterNotAllowedDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-media-type-del-in-parameter-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-media-type-del-in-parameter-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationLeft(\n          DiffViolationMessages.OP_DEL_FORBIDDEN,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"content.'application/json'\", MEDIA_TYPE\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public MediaTypeDiffValidator mediaTypeDelInParameterNotAllowedDiffValidator() {\n\n      return new MediaTypeDelInParameterNotAllowedDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/MediaTypeDelInRequestBodyNotAllowedDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MediaTypeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = MediaTypeDelInRequestBodyNotAllowedDiffValidatorTest.TestConfiguration.class)\npublic class MediaTypeDelInRequestBodyNotAllowedDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-media-type-del-in-request-body-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-media-type-del-in-request-body-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationLeft(\n          DiffViolationMessages.OP_DEL_FORBIDDEN,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/json'\", MEDIA_TYPE\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public MediaTypeDiffValidator mediaTypeDelInRequestBodyNotAllowedDiffValidator() {\n\n      return new MediaTypeDelInRequestBodyNotAllowedDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/MediaTypeDelInResponseNotAllowedDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MediaTypeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = MediaTypeDelInResponseNotAllowedDiffValidatorTest.TestConfiguration.class)\npublic class MediaTypeDelInResponseNotAllowedDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-media-type-del-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-media-type-del-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationLeft(\n          DiffViolationMessages.OP_DEL_FORBIDDEN,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public MediaTypeDiffValidator mediaTypeDelInResponseNotAllowedDiffValidator() {\n\n      return new MediaTypeDelInResponseNotAllowedDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/operation/OperationDeleteNotAllowedDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.operation;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OperationDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = OperationDeleteNotAllowedDiffValidatorTest.TestConfiguration.class)\npublic class OperationDeleteNotAllowedDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-operation-delete-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-operation-delete-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationLeft(\n          DiffViolationMessages.OP_DEL_FORBIDDEN,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public OperationDiffValidator operationDeleteNotAllowedDiffValidator() {\n\n      return new OperationDeleteNotAllowedDiffValidator();\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/operation/OperationIdNotSameDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.operation;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OperationDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = OperationIdNotSameDiffValidatorTest.TestConfiguration.class)\npublic class OperationIdNotSameDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-operation-id-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-operation-id-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"operationId\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public OperationDiffValidator operationIdNotSameDiffValidator() {\n\n      return new OperationIdNotSameDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/ParameterAddDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter.ParameterAddDiffValidator.VIOLATION_MESSAGE;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ParameterAddDiffValidatorTest.TestConfiguration.class)\npublic class ParameterAddDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-parameter-add-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-parameter-add-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationRight(\n          \"[name=bar,in=query]:\" + VIOLATION_MESSAGE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[1]\", PARAMETER,\n            \"required\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public ParameterDiffValidator parameterAddDiffValidator() {\n\n      return new ParameterAddDiffValidator();\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/ParameterAllowEmptyValueChangeDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ParameterAllowEmptyValueChangeDiffValidatorTest.TestConfiguration.class)\npublic class ParameterAllowEmptyValueChangeDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-parameter-allow-empty-value-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-parameter-allow-empty-value-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(\n          \"[name=limit4,in=query]:\" + DiffViolationMessages.FALSE_TO_TRUE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[1]\", PARAMETER,\n            \"allowEmptyValue\", null\n          },\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[2]\", PARAMETER,\n            \"allowEmptyValue\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public ParameterDiffValidator parameterAllowEmptyValueChangeDiffValidator() {\n\n      return new ParameterAllowEmptyValueChangeDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/ParameterAllowReservedChangeDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ParameterAllowReservedChangeDiffValidatorTest.TestConfiguration.class)\npublic class ParameterAllowReservedChangeDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n  }\n\n  @Test\n  public void validateBroken() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-parameter-allow-reserved-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-parameter-allow-reserved-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(\n          \"[name=limit4,in=query]:\" + DiffViolationMessages.FALSE_TO_TRUE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[1]\", PARAMETER,\n            \"allowReserved\", null\n          },\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[2]\", PARAMETER,\n            \"allowReserved\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public ParameterDiffValidator parameterAllowReservedChangeDiffValidator() {\n\n      return new ParameterAllowReservedChangeDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/ParameterExplodeNotSameDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ParameterExplodeNotSameDiffValidatorTest.TestConfiguration.class)\npublic class ParameterExplodeNotSameDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-parameter-explode-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-parameter-explode-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(\n          \"[name=limit,in=query]:\" + DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"explode\", null\n          },\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[1]\", PARAMETER,\n            \"explode\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public ParameterDiffValidator parameterExplodeNotSameDiffValidator() {\n\n      return new ParameterExplodeNotSameDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/ParameterRequiredChangeDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ParameterRequiredChangeDiffValidatorTest.TestConfiguration.class)\npublic class ParameterRequiredChangeDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-parameter-required-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-parameter-required-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(\n          \"[name=limit,in=query]:\" + DiffViolationMessages.TRUE_TO_FALSE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"required\", null\n          },\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[1]\", PARAMETER,\n            \"required\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public ParameterDiffValidator parameterRequiredChangeDiffValidator() {\n\n      return new ParameterRequiredChangeDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/ParameterStyleNotSameDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ParameterStyleNotSameDiffValidatorTest.TestConfiguration.class)\npublic class ParameterStyleNotSameDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-parameter-style-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-parameter-style-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(\n          \"[name=limit,in=query]:\" + DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"style\", null\n          },\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[1]\", PARAMETER,\n            \"style\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public ParameterDiffValidator parameterStyleNotSameDiffValidator() {\n\n      return new ParameterStyleNotSameDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/pathitem/PathItemDeleteNotAllowedDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.pathitem;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.PathItemDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PATHS;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PATH_ITEM;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = PathItemDeleteNotAllowedDiffValidatorTest.TestConfiguration.class)\npublic class PathItemDeleteNotAllowedDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-path-item-delete-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-path-item-delete-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationLeft(\n          DiffViolationMessages.OP_DEL_FORBIDDEN,\n          new Object[] { \"paths\", PATHS, \"/pets/{petId}\", PATH_ITEM }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n\n    public PathItemDiffValidator pathItemDeleteNotAllowedValidator() {\n\n      return new PathItemDeleteNotAllowedDiffValidator();\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/requestbody/RequestBodyRequiredChangeDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.requestbody;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.RequestBodyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = RequestBodyRequiredChangeDiffValidatorTest.TestConfiguration.class)\npublic class RequestBodyRequiredChangeDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-request-body-required-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-request-body-required-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.TRUE_TO_FALSE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"required\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public RequestBodyDiffValidator requestBodyRequiredChangeDiffValidator() {\n\n      return new RequestBodyRequiredChangeDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/response/ResponseAddNotAllowedDiffValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ResponseDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class ResponseAddNotAllowedDiffValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-response-add-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-response-add-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationRight(\n          DiffViolationMessages.OP_ADD_FORBIDDEN,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"302\", RESPONSE\n          }\n        ),\n        createViolationRight(\n          DiffViolationMessages.OP_ADD_FORBIDDEN,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"default\", RESPONSE\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public ResponseDiffValidator responseAddNotAllowedDiffValidator() {\n      return new ResponseAddNotAllowedDiffValidator();\n    }\n\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/SchemaDiscriminatorChangeValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaDiscriminatorChangeValidatorTest.TestConfiguration.class)\npublic class SchemaDiscriminatorChangeValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-discriminator-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-discriminator-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"discriminator\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"discriminator\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"discriminator\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaDiscriminatorChangeValidator() {\n\n      return new SchemaDiscriminatorChangeValidator();\n    }\n\n  }\n\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/SchemaReadOnlyChangeValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaReadOnlyChangeValidatorTest.TestConfiguration.class)\npublic class SchemaReadOnlyChangeValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-read-only-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-read-only-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"readOnly\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"readOnly\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"readOnly\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaReadOnlyChangeValidator() {\n\n      return new SchemaReadOnlyChangeValidator();\n    }\n\n  }\n\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/SchemaWriteOnlyChangeValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaWriteOnlyChangeValidatorTest.TestConfiguration.class)\npublic class SchemaWriteOnlyChangeValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-write-only-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-write-only-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"writeOnly\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"writeOnly\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"writeOnly\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaWriteOnlyChangeValidator() {\n\n      return new SchemaWriteOnlyChangeValidator();\n    }\n\n  }\n\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/SchemaXmlChangeValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaXmlChangeValidatorTest.TestConfiguration.class)\npublic class SchemaXmlChangeValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-xml-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-xml-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"xml\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"xml\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_EQ_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"xml\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaXmlChangeValidator() {\n\n      return new SchemaXmlChangeValidator();\n    }\n\n  }\n\n}\n\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaEnumChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.MEDIA_TYPE;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.OPERATION;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PARAMETER;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PATHS;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PATH_ITEM;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.REQUEST_BODY;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SCHEMA;\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport io.swagger.v3.oas.models.OpenAPI;\n\n@ContextConfiguration(classes = SchemaEnumChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaEnumChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-enum-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-enum-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n            SchemaEnumChangeInRequestValidator.VIOLATION_MESSAGE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"enum\", null\n          }\n        ),\n        createViolationBoth(\n            SchemaEnumChangeInRequestValidator.VIOLATION_MESSAGE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"enum\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaEnumChangeInRequestValidator() {\n\n      return new SchemaEnumChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaExclusiveMaximumChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaExclusiveMaximumChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaExclusiveMaximumChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-exclusive-maximum-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-exclusive-maximum-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.TRUE_TO_FALSE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"exclusiveMaximum\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.TRUE_TO_FALSE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"exclusiveMaximum\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaExclusiveMaximumChangeInRequestValidator() {\n\n      return new SchemaExclusiveMaximumChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaExclusiveMinimumChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaExclusiveMinimumChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaExclusiveMinimumChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-exclusive-minimum-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-exclusive-minimum-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.TRUE_TO_FALSE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"exclusiveMinimum\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.TRUE_TO_FALSE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"exclusiveMinimum\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaExclusiveMinimumChangeInRequestValidator() {\n\n      return new SchemaExclusiveMinimumChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMaxItemsChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMaxItemsChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaMaxItemsChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-max-items-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-max-items-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_GTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"maxItems\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_GTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"maxItems\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMaxItemsChangeInRequestValidator() {\n\n      return new SchemaMaxItemsChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMaxLengthChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMaxLengthChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaMaxLengthChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-max-length-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-max-length-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_GTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"maxLength\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_GTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"maxLength\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMaxLengthChangeInRequestValidator() {\n\n      return new SchemaMaxLengthChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMaxPropertiesChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMaxPropertiesChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaMaxPropertiesChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-max-properties-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-max-properties-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_GTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"maxProperties\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_GTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"maxProperties\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMaxPropertiesChangeInRequestValidator() {\n\n      return new SchemaMaxPropertiesChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMaximumChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMaximumChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaMaximumChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-maximum-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-maximum-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_GTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"maximum\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_GTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"maximum\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMaximumChangeInRequestValidator() {\n\n      return new SchemaMaximumChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMinItemsChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMinItemsChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaMinItemsChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-min-items-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-min-items-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_LTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"minItems\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_LTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"minItems\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMinItemsChangeInRequestValidator() {\n\n      return new SchemaMinItemsChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMinLengthChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMinLengthChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaMinLengthChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-min-length-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-min-length-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_LTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"minLength\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_LTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"minLength\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMinLengthChangeInRequestValidator() {\n\n      return new SchemaMinLengthChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMinPropertiesChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMinPropertiesChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaMinPropertiesChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-min-properties-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-min-properties-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_LTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"minProperties\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_LTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"minProperties\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMinPropertiesChangeInRequestValidator() {\n\n      return new SchemaMinPropertiesChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMinimumChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMinimumChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaMinimumChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-minimum-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-minimum-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_LTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"minimum\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_LTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"minimum\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMinimumChangeInRequestValidator() {\n\n      return new SchemaMinimumChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaMultipleOfChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMultipleOfChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaMultipleOfChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-multiple-of-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-multiple-of-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n            SchemaMultipleOfChangeInRequestValidator.VIOLATION_MESSAGE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"multipleOf\", null\n          }\n        ),\n        createViolationBoth(\n            SchemaMultipleOfChangeInRequestValidator.VIOLATION_MESSAGE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"multipleOf\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMultipleOfChangeValidator() {\n\n      return new SchemaMultipleOfChangeInRequestValidator();\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaNullableChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaNullableChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaNullableChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-nullable-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-nullable-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.FALSE_TO_TRUE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"nullable\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.FALSE_TO_TRUE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"nullable\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaNullableChangeInRequestValidator() {\n\n      return new SchemaNullableChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaRequiredChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaRequiredChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaRequiredChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-required-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-required-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n            SchemaRequiredChangeInRequestValidator.VIOLATION_MESSAGE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"required\", null\n          }\n        ),\n        createViolationBoth(\n            SchemaRequiredChangeInRequestValidator.VIOLATION_MESSAGE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"required\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaRequiredChangeInRequestValidator() {\n\n      return new SchemaRequiredChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaTypeFormatChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaTypeFormatChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaTypeFormatChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-type-format-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-type-format-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          \"the change (type=integer,format=null)->(type=string,format=null) is not allowed\",\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA\n          }\n        ),\n\n        createViolationBoth(\n          \"the change (type=integer,format=null)->(type=string,format=null) is not allowed\",\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaTypeFormatInRequestCompareValidator() {\n\n      return new SchemaTypeFormatChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaUniqueItemsChangeInRequestValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaUniqueItemsChangeInRequestValidatorTest.TestConfiguration.class)\npublic class SchemaUniqueItemsChangeInRequestValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-unique-items-in-request-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-unique-items-in-request-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.TRUE_TO_FALSE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"parameters[0]\", PARAMETER,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"uniqueItems\", null\n          }\n        ),\n        createViolationBoth(\n          DiffViolationMessages.TRUE_TO_FALSE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"uniqueItems\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaUniqueItemsChangeInRequestValidator() {\n\n      return new SchemaUniqueItemsChangeInRequestValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaEnumChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaEnumChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaEnumChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-enum-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-enum-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n            SchemaEnumChangeInResponseValidator.VIOLATION_MESSAGE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"enum\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaEnumChangeInResponseValidator() {\n\n      return new SchemaEnumChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaExclusiveMaximumChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaExclusiveMaximumChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaExclusiveMaximumChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-exclusive-maximum-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-exclusive-maximum-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.FALSE_TO_TRUE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"exclusiveMaximum\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaExclusiveMaximumChangeInResponseValidator() {\n\n      return new SchemaExclusiveMaximumChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaExclusiveMinimumChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaExclusiveMinimumChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaExclusiveMinimumChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-exclusive-minimum-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-exclusive-minimum-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.FALSE_TO_TRUE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"exclusiveMinimum\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaExclusiveMinimumChangeInResponseValidator() {\n\n      return new SchemaExclusiveMinimumChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMaxItemsChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMaxItemsChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaMaxItemsChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-max-items-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-max-items-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_LTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"maxItems\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMaxItemsChangeInResponseValidator() {\n\n      return new SchemaMaxItemsChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMaxLengthChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMaxLengthChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaMaxLengthChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-max-length-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-max-length-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_LTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"maxLength\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMaxLengthChangeInResponseValidator() {\n\n      return new SchemaMaxLengthChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMaxPropertiesChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMaxPropertiesChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaMaxPropertiesChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-max-properties-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-max-properties-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_LTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"maxProperties\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMaxPropertiesChangeInResponseValidator() {\n\n      return new SchemaMaxPropertiesChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMaximumChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMaximumChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaMaximumChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-maximum-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-maximum-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_LTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"maximum\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMaximumChangeInResponseValidator() {\n\n      return new SchemaMaximumChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMinItemsChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMinItemsChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaMinItemsChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-min-items-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-min-items-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_GTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"minItems\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMinItemsChangeInResponseValidator() {\n\n      return new SchemaMinItemsChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMinLengthChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMinLengthChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaMinLengthChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-min-length-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-min-length-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_GTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"minLength\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMinLengthChangeInResponseValidator() {\n\n      return new SchemaMinLengthChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMinPropertiesChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMinPropertiesChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaMinPropertiesChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-min-properties-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-min-properties-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_GTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"minProperties\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMinPropertiesChangeInResponseValidator() {\n\n      return new SchemaMinPropertiesChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMinimumChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMinimumChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaMinimumChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-minimum-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-minimum-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.NEW_NOT_GTE_OLD,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"minimum\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMinimumChangeInResponseValidator() {\n\n      return new SchemaMinimumChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaMultipleOfChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaMultipleOfChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaMultipleOfChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-multiple-of-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-multiple-of-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n            SchemaMultipleOfChangeInResponseValidator.VIOLATION_MESSAGE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/json'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"multipleOf\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaMultipleOfChangeValidator() {\n\n      return new SchemaMultipleOfChangeInResponseValidator();\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaNullableChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaNullableChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaNullableChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-nullable-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-nullable-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.TRUE_TO_FALSE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"nullable\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaNullableChangeInResponseValidator() {\n\n      return new SchemaNullableChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaRequiredChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaRequiredChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaRequiredChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-required-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-required-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n            SchemaRequiredChangeInResponseValidator.VIOLATION_MESSAGE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"required\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaRequiredChangeInResponseValidator() {\n\n      return new SchemaRequiredChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaTypeFormatChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaTypeFormatChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaTypeFormatChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-type-format-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-type-format-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          \"the change (type=integer,format=int32)->(type=integer,format=int64) is not allowed\",\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaTypeFormatInResponseCompareValidator() {\n\n      return new SchemaTypeFormatChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/SchemaUniqueItemsChangeInResponseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DiffViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.Test;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = SchemaUniqueItemsChangeInResponseValidatorTest.TestConfiguration.class)\npublic class SchemaUniqueItemsChangeInResponseValidatorTest extends OasCompatibilityTestBase {\n\n  @Test\n  public void validate() {\n    OpenAPI leftOpenAPI = loadRelative(\"petstore-schema-unique-items-in-response-a.yaml\");\n    OpenAPI rightOpenAPI = loadRelative(\"petstore-schema-unique-items-in-response-b.yaml\");\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n      .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolationBoth(\n          DiffViolationMessages.FALSE_TO_TRUE,\n          new Object[] {\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"get\", OPERATION,\n            \"responses\", RESPONSES,\n            \"200\", RESPONSE,\n            \"content.'application/xml'\", MEDIA_TYPE,\n            \"schema\", SCHEMA,\n            \"properties.'foo'\", SCHEMA,\n            \"uniqueItems\", null\n          }\n        )\n      );\n\n  }\n\n  @Configuration\n  @Import(OasDiffValidatorsSkeletonConfiguration.class)\n  public static class TestConfiguration {\n\n    @Bean\n    public SchemaCompareValidator schemaUniqueItemsChangeInResponseValidator() {\n\n      return new SchemaUniqueItemsChangeInResponseValidator();\n    }\n\n  }\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/logback-test.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<configuration>\n  <include resource=\"org/springframework/boot/logging/logback/base.xml\" />\n  <logger name=\"org.springframework\" level=\"OFF\"/>\n</configuration>\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/parser-test.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Pet petstore\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/petstore-encoding-add-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/petstore-encoding-add-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n              bar:\n                contentType: 'application/octet-stream'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/petstore-encoding-allow-reserved-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n                allowReserved: true\n              bar:\n                contentType: 'application/octet-stream'\n                allowReserved: false\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/petstore-encoding-allow-reserved-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n                allowReserved: false\n              bar:\n                contentType: 'application/octet-stream'\n                allowReserved: true\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/petstore-encoding-content-type-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/petstore-encoding-content-type-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'text/plain'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/petstore-encoding-del-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n              bar:\n                contentType: 'application/octet-stream'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/petstore-encoding-del-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/petstore-encoding-explode-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n                explode: true\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/petstore-encoding-explode-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n                explode: false\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/petstore-encoding-style-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'text/plain'\n                style: form\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/encoding/petstore-encoding-style-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'text/plain'\n                style: spaceDelimited\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/header/petstore-header-add-in-request-body-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/header/petstore-header-add-in-request-body-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n                headers:\n                  X-Foo:\n                    schema:\n                      type: string\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/header/petstore-header-del-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            X-Foo:\n              schema:\n                type: string\n            X-Bar:\n              schema:\n                type: string\n\n    post:\n      summary: List all pets\n      operationId: foo\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/header/petstore-header-del-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            X-Foo:\n              schema:\n                type: string\n\n    post:\n      summary: List all pets\n      operationId: foo\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/petstore-media-type-add-in-parameter-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo\n          in: query\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/petstore-media-type-add-in-parameter-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo\n          in: query\n          content:\n            application/json:\n              schema:\n                type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: bar\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/petstore-media-type-del-in-parameter-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo\n          in: query\n          content:\n            application/json:\n              schema:\n                type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: bar\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/petstore-media-type-del-in-parameter-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo\n          in: query\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/petstore-media-type-del-in-request-body-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: string\n          application/xml:\n            schema:\n              type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: bar\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/petstore-media-type-del-in-request-body-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: bar\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/petstore-media-type-del-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/json:\n              schema:\n                type: string\n            application/xml:\n              schema:\n                type: string\n\n    post:\n      summary: List all pets\n      operationId: bar\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/mediatype/petstore-media-type-del-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/json:\n              schema:\n                type: string\n\n    post:\n      summary: List all pets\n      operationId: bar\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/operation/petstore-operation-delete-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/operation/petstore-operation-delete-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/operation/petstore-operation-id-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/operation/petstore-operation-id-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: bar\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/petstore-parameter-add-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          required: false\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/petstore-parameter-add-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    parameters:\n      - name: foo\n        in: query\n      - name: bar\n        in: query\n        required: true\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          required: false\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/petstore-parameter-allow-empty-value-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: limit3\n          in: query\n          allowEmptyValue: false\n        - name: limit4\n          in: query\n          allowEmptyValue: true\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/petstore-parameter-allow-empty-value-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: foo\n          in: query\n        - name: limit3\n          in: query\n          allowEmptyValue: true\n        - name: limit4\n          in: query\n          allowEmptyValue: false\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/petstore-parameter-allow-reserved-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: limit3\n          in: query\n          allowReserved: false\n        - name: limit4\n          in: query\n          allowReserved: true\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/petstore-parameter-allow-reserved-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: foo\n          in: query\n        - name: limit3\n          in: query\n          allowReserved: true\n        - name: limit4\n          in: query\n          allowReserved: false\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/petstore-parameter-explode-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          explode: true\n        - name: limit2\n          in: query\n          explode: true\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/petstore-parameter-explode-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: foo\n          in: query\n        - name: limit\n          in: query\n          explode: false\n        - name: limit2\n          in: query\n          explode: true\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/petstore-parameter-required-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          required: false\n        - name: limit2\n          in: query\n          required: true\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/petstore-parameter-required-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: foo\n          in: query\n        - name: limit\n          in: query\n          required: true\n        - name: limit2\n          in: query\n          required: false\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/petstore-parameter-style-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          style: simple\n        - name: limit2\n          in: query\n          style: form\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/parameter/petstore-parameter-style-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: foo\n          in: query\n        - name: limit\n          in: query\n          style: form\n        - name: limit2\n          in: query\n          style: form\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/pathitem/petstore-path-item-delete-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/pathitem/petstore-path-item-delete-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n  /pets/{PetId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: PetId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/requestbody/petstore-request-body-required-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: bar\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: string\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/requestbody/petstore-request-body-required-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: bar\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: string\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/response/petstore-response-add-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: bar\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/response/petstore-response-add-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n        '302':\n          description: foo\n        default:\n          description: bar\n\n    post:\n      summary: List all pets\n      operationId: bar\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/petstore-schema-discriminator-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: object\n                properties:\n                  petType:\n                    type: string\n                  petId:\n                    type: string\n                discriminator:\n                  propertyName: petType\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: object\n                properties:\n                  petType:\n                    type: string\n                  petId:\n                    type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: object\n                  properties:\n                    petType:\n                      type: string\n                    petId:\n                      type: string\n                  discriminator:\n                    propertyName: petType\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: object\n                  properties:\n                    petType:\n                      type: string\n                    petId:\n                      type: string\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                properties:\n                  foo:\n                    type: object\n                    properties:\n                      petType:\n                        type: string\n                      petId:\n                        type: string\n                    discriminator:\n                      propertyName: petType\n            application/json:\n              schema:\n                properties:\n                  foo:\n                    type: object\n                    properties:\n                      petType:\n                        type: string\n                      petId:\n                        type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/petstore-schema-discriminator-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: object\n                properties:\n                  petType:\n                    type: string\n                  petId:\n                    type: string\n                discriminator:\n                  propertyName: petId\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: object\n                properties:\n                  petType:\n                    type: string\n                  petId:\n                    type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: object\n                  properties:\n                    petType:\n                      type: string\n                    petId:\n                      type: string\n                  discriminator:\n                    propertyName: petId\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: object\n                  properties:\n                    petType:\n                      type: string\n                    petId:\n                      type: string\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                properties:\n                  foo:\n                    type: object\n                    properties:\n                      petType:\n                        type: string\n                      petId:\n                        type: string\n                    discriminator:\n                      propertyName: petId\n            application/json:\n              schema:\n                properties:\n                  foo:\n                    type: object\n                    properties:\n                      petType:\n                        type: string\n                      petId:\n                        type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/petstore-schema-read-only-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                readOnly: true\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  readOnly: true\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                properties:\n                  foo:\n                    type: integer\n                    readOnly: true\n            application/json:\n              schema:\n                properties:\n                  foo:\n                    type: integer\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/petstore-schema-read-only-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                readOnly: false\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  readOnly: false\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                properties:\n                  foo:\n                    type: integer\n                    readOnly: false\n            application/json:\n              schema:\n                properties:\n                  foo:\n                    type: integer\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/petstore-schema-write-only-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                writeOnly: true\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  writeOnly: true\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  writeOnly: true\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                properties:\n                  foo:\n                    type: integer\n                    writeOnly: true\n            application/json:\n              schema:\n                properties:\n                  foo:\n                    type: integer\n                    writeOnly: true\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/petstore-schema-write-only-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                writeOnly: false\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  writeOnly: false\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  writeOnly: true\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                properties:\n                  foo:\n                    type: integer\n                    writeOnly: false\n            application/json:\n              schema:\n                properties:\n                  foo:\n                    type: integer\n                    writeOnly: true\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/petstore-schema-xml-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                properties:\n                  foo:\n                    type: string\n            application/json:\n              schema:\n                properties:\n                  foo:\n                    type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/petstore-schema-xml-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n                xml:\n                  name: foo\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                  xml:\n                    name: foo\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                properties:\n                  foo:\n                    type: string\n                    xml:\n                      name: foo\n            application/json:\n              schema:\n                properties:\n                  foo:\n                    type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-enum-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n                enum:\n                  - a\n                  - b\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                  enum:\n                    - a\n                    - b\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-enum-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n                enum:\n                  - a\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                  enum:\n                    - a\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-exclusive-maximum-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                maximum: 1\n                exclusiveMaximum: false\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  maximum: 1\n                  exclusiveMaximum: false\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-exclusive-maximum-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                maximum: 1\n                exclusiveMaximum: true\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  maximum: 1\n                  exclusiveMaximum: true\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-exclusive-minimum-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                minimum: 1\n                exclusiveMinimum: false\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  minimum: 1\n                  exclusiveMinimum: false\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-exclusive-minimum-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                minimum: 1\n                exclusiveMinimum: true\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  minimum: 1\n                  exclusiveMinimum: true\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-max-items-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: array\n                items:\n                  type: string\n                maxItems: 1\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: array\n                items:\n                  type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: array\n                  items:\n                    type: string\n                  maxItems: 1\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: array\n                  items:\n                    type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-max-items-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: array\n                items:\n                  type: string\n                maxItems: 0\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: array\n                items:\n                  type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: array\n                  items:\n                    type: string\n                  maxItems: 0\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: array\n                  items:\n                    type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-max-length-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n                maxLength: 1\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                  maxLength: 1\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-max-length-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n                maxLength: 0\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                  maxLength: 0\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-max-properties-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: object\n                maxProperties: 1\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: object\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: object\n                  maxProperties: 1\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: object\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-max-properties-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: object\n                maxProperties: 0\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: object\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: object\n                  maxProperties: 0\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: object\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-maximum-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                maximum: 1\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  maximum: 1\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-maximum-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                maximum: 0\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  maximum: 0\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-min-items-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: array\n                items:\n                  type: string\n                minItems: 1\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: array\n                items:\n                  type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: array\n                  items:\n                    type: string\n                  minItems: 1\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: array\n                  items:\n                    type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-min-items-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: array\n                items:\n                  type: string\n                minItems: 2\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: array\n                items:\n                  type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: array\n                  items:\n                    type: string\n                  minItems: 2\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: array\n                  items:\n                    type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-min-length-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n                minLength: 1\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                  minLength: 1\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-min-length-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n                minLength: 2\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                  minLength: 2\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-min-properties-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: object\n                minProperties: 1\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: object\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: object\n                  minProperties: 1\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: object\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-min-properties-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: object\n                minProperties: 2\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: object\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: object\n                  minProperties: 2\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: object\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-minimum-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                minimum: 1\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  minimum: 1\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-minimum-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                minimum: 2\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  minimum: 2\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-multiple-of-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                multipleOf: 6\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                multipleOf: 6\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  multipleOf: 6\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  multipleOf: 6\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-multiple-of-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                multipleOf: 4\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n                multipleOf: 2\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  multipleOf: 4\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n                  multipleOf: 2\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-nullable-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n                nullable: true\n              bar:\n                type: string\n        - name: foo2\n          in: query\n          schema:\n            type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                  nullable: true\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-nullable-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n                nullable: false\n              bar:\n                type: string\n                nullable: true\n        - name: foo2\n          in: query\n          schema:\n            type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                  nullable: false\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-required-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-required-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n            required:\n              - foo\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n              required:\n                - foo\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-type-format-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-type-format-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: string\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: integer\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: integer\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-unique-items-in-request-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: array\n                items:\n                  type: string\n                uniqueItems: false\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: array\n                items:\n                  type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: array\n                  items:\n                    type: string\n                  uniqueItems: false\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: array\n                  items:\n                    type: string\n\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/petstore-schema-unique-items-in-request-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      parameters:\n        - name: foo1\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: array\n                items:\n                  type: string\n                uniqueItems: true\n        - name: foo2\n          in: query\n          schema:\n            type: object\n            properties:\n              foo:\n                type: array\n                items:\n                  type: string\n      requestBody:\n        content:\n          application/xml:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: array\n                  items:\n                    type: string\n                  uniqueItems: true\n          application/json:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: array\n                  items:\n                    type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-enum-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n                    enum:\n                      - a\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-enum-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n                    enum:\n                      - a\n                      - b\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-exclusive-maximum-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    maximum: 0\n                    exclusiveMaximum: true\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-exclusive-maximum-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    maximum: 0\n                    exclusiveMaximum: false\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-exclusive-minimum-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    minimum: 0\n                    exclusiveMinimum: true\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-exclusive-minimum-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    minimum: 0\n                    exclusiveMinimum: false\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-max-items-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: array\n                    items:\n                      type: string\n                    maxItems: 1\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: array\n                    items:\n                      type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-max-items-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: array\n                    items:\n                      type: string\n                    maxItems: 2\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: array\n                    items:\n                      type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-max-length-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n                    maxLength: 1\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-max-length-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n                    maxLength: 2\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-max-properties-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: object\n                    maxProperties: 1\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: object\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-max-properties-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: object\n                    maxProperties: 2\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: object\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-maximum-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    maximum: 0\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-maximum-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    maximum: 1\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-min-items-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: array\n                    items:\n                      type: string\n                    minItems: 1\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: array\n                    items:\n                      type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-min-items-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: array\n                    items:\n                      type: string\n                    minItems: 0\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: array\n                    items:\n                      type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-min-length-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n                    minLength: 1\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-min-length-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n                    minLength: 0\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-min-properties-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: object\n                    minProperties: 1\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: object\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-min-properties-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: object\n                    minProperties: 0\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: object\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-minimum-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    minimum: 1\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-minimum-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    minimum: 0\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-multiple-of-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    multipleOf: 3\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    multipleOf: 3\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-multiple-of-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    multipleOf: 4\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    multipleOf: 6\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-nullable-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n                    nullable: false\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-nullable-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n                    nullable: true\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-required-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n                required:\n                  - foo\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n                required:\n                  - foo\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-required-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: string\n                required:\n                  - foo\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-type-format-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    format: int32\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-type-format-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n                    format: int64\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: integer\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-unique-items-in-response-a.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: array\n                    items:\n                      type: string\n                    uniqueItems: true\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: array\n                    items:\n                      type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility/src/test/resources/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/response/petstore-schema-unique-items-in-response-b.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/xml:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: array\n                    items:\n                      type: string\n                    uniqueItems: false\n            application/json:\n              schema:\n                type: object\n                properties:\n                  foo:\n                    type: array\n                    items:\n                      type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility-spring/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n  <parent>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>oas-validator-parent</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <relativePath>../pom.xml</relativePath>\n  </parent>\n\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>oas-validator-compatibility-spring</artifactId>\n\n  <dependencies>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-compatibility</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-core-spring</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-test</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-plugin</artifactId>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-report-plugin</artifactId>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility-spring/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/config/EncodingDiffValidatorsConfiguration.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.config;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.encoding.*;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\npublic class EncodingDiffValidatorsConfiguration {\n\n  @Bean\n  public EncodingDiffValidator encodingAddNotAllowedDiffValidator() {\n    return new EncodingAddNotAllowedDiffValidator();\n  }\n\n  @Bean\n  public EncodingDiffValidator encodingDelNotAllowedDiffValidator() {\n    return new EncodingDelNotAllowedDiffValidator();\n  }\n\n  @Bean\n  public EncodingDiffValidator encodingAllowedReservedChangeDiffValidator() {\n    return new EncodingAllowedReservedChangeDiffValidator();\n  }\n\n  @Bean\n  public EncodingDiffValidator encodingContentTypeNotSameDiffValidator() {\n    return new EncodingContentTypeNotSameDiffValidator();\n  }\n\n  @Bean\n  public EncodingDiffValidator encodingExplodeNotSameDiffValidator() {\n    return new EncodingExplodeNotSameDiffValidator();\n  }\n\n  @Bean\n  public EncodingDiffValidator encodingStyleNotSameDiffValidator() {\n    return new EncodingStyleNotSameDiffValidator();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility-spring/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/config/HeaderDiffValidatorsConfiguration.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.config;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.HeaderDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.header.HeaderAddInRequestBodyNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.header.HeaderDelInResponseNotAllowedDiffValidator;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\npublic class HeaderDiffValidatorsConfiguration {\n\n  @Bean\n  public HeaderDiffValidator headerAddInRequestBodyNotAllowedDiffValidator() {\n    return new HeaderAddInRequestBodyNotAllowedDiffValidator();\n  }\n\n  @Bean\n  public HeaderDiffValidator headerDelInResponseNotAllowedDiffValidator() {\n    return new HeaderDelInResponseNotAllowedDiffValidator();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility-spring/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/config/MediaTypeDiffValidatorsConfiguration.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.config;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MediaTypeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype.MediaTypeAddInParameterNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype.MediaTypeDelInParameterNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype.MediaTypeDelInRequestBodyNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.mediatype.MediaTypeDelInResponseNotAllowedDiffValidator;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\npublic class MediaTypeDiffValidatorsConfiguration {\n\n  @Bean\n  public MediaTypeDiffValidator mediaTypeAddInParameterNotAllowedDiffValidator() {\n    return new MediaTypeAddInParameterNotAllowedDiffValidator();\n  }\n\n  @Bean\n  public MediaTypeDiffValidator mediaTypeDelInParameterNotAllowedDiffValidator() {\n    return new MediaTypeDelInParameterNotAllowedDiffValidator();\n  }\n\n  @Bean\n  public MediaTypeDiffValidator mediaTypeDelInRequestBodyNotAllowedDiffValidator() {\n    return new MediaTypeDelInRequestBodyNotAllowedDiffValidator();\n  }\n\n  @Bean\n  public MediaTypeDiffValidator mediaTypeDelInResponseNotAllowedDiffValidator() {\n    return new MediaTypeDelInResponseNotAllowedDiffValidator();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility-spring/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/config/OperationDiffValidatorsConfiguration.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.config;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.operation.OperationDeleteNotAllowedDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.operation.OperationIdNotSameDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OperationDiffValidator;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\npublic class OperationDiffValidatorsConfiguration {\n\n  @Bean\n  public OperationDiffValidator operationDeleteNotAllowedDiffValidator() {\n    return new OperationDeleteNotAllowedDiffValidator();\n  }\n\n  @Bean\n  public OperationDiffValidator operationIdNotSameDiffValidator() {\n    return new OperationIdNotSameDiffValidator();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility-spring/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/config/ParameterDiffValidatorsConfiguration.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.config;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.parameter.*;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\npublic class ParameterDiffValidatorsConfiguration {\n\n  @Bean\n  public ParameterDiffValidator parameterAddDiffValidator() {\n    return new ParameterAddDiffValidator();\n  }\n\n  @Bean\n  public ParameterDiffValidator parameterRequiredChangeDiffValidator() {\n    return new ParameterRequiredChangeDiffValidator();\n  }\n\n  @Bean\n  public ParameterDiffValidator parameterAllowEmptyValueChangeDiffValidator() {\n    return new ParameterAllowEmptyValueChangeDiffValidator();\n  }\n\n  @Bean\n  public ParameterDiffValidator parameterStyleNotSameDiffValidator() {\n    return new ParameterStyleNotSameDiffValidator();\n  }\n\n  @Bean\n  public ParameterDiffValidator parameterExplodeNotSameDiffValidator() {\n    return new ParameterExplodeNotSameDiffValidator();\n  }\n\n  @Bean\n  public ParameterDiffValidator parameterAllowReservedChangeDiffValidator() {\n    return new ParameterAllowReservedChangeDiffValidator();\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility-spring/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/config/PathItemDiffValidatorsConfiguration.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.config;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.PathItemDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.pathitem.PathItemDeleteNotAllowedDiffValidator;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\npublic class PathItemDiffValidatorsConfiguration {\n\n  @Bean\n  public PathItemDiffValidator pathItemDeleteNotAllowedValidator() {\n    return new PathItemDeleteNotAllowedDiffValidator();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility-spring/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/config/RequestBodyDiffValidatorsConfiguration.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.config;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.RequestBodyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.requestbody.RequestBodyRequiredChangeDiffValidator;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\npublic class RequestBodyDiffValidatorsConfiguration {\n\n  @Bean\n  public RequestBodyDiffValidator requestBodyRequiredChangeDiffValidator() {\n    return new RequestBodyRequiredChangeDiffValidator();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility-spring/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/config/ResponseDiffValidatorsConfiguration.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.config;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ResponseDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.response.ResponseAddNotAllowedDiffValidator;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\npublic class ResponseDiffValidatorsConfiguration {\n\n  @Bean\n  public ResponseDiffValidator responseAddNotAllowedDiffValidator() {\n    return new ResponseAddNotAllowedDiffValidator();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility-spring/src/main/java/org/apache/servicecomb/toolkit/oasv/compatibility/config/SchemaDiffValidatorsConfiguration.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.config;\n\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.request.*;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.response.*;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaDiscriminatorChangeValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaReadOnlyChangeValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaWriteOnlyChangeValidator;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.validators.schema.SchemaXmlChangeValidator;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\npublic class SchemaDiffValidatorsConfiguration {\n\n  @Bean\n  public SchemaCompareValidator schemaTypeFormatInRequestCompareValidator() {\n    return new SchemaTypeFormatChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaTypeFormatInResponseCompareValidator() {\n    return new SchemaTypeFormatChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMultipleOfChangeInRequestValidator() {\n    return new SchemaMultipleOfChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMaximumChangeInResponseValidator() {\n    return new SchemaMaximumChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMaximumChangeInRequestValidator() {\n    return new SchemaMaximumChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaExclusiveMinimumChangeInRequestValidator() {\n    return new SchemaExclusiveMinimumChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaExclusiveMaximumChangeInRequestValidator() {\n    return new SchemaExclusiveMaximumChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaExclusiveMaximumChangeInResponseValidator() {\n    return new SchemaExclusiveMaximumChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaExclusiveMinimumChangeInResponseValidator() {\n    return new SchemaExclusiveMinimumChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMaxItemsChangeInRequestValidator() {\n    return new SchemaMaxItemsChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMaxLengthChangeInRequestValidator() {\n    return new SchemaMaxLengthChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMaxPropertiesChangeInRequestValidator() {\n    return new SchemaMaxPropertiesChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMinimumChangeInRequestValidator() {\n    return new SchemaMinimumChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMinItemsChangeInRequestValidator() {\n    return new SchemaMinItemsChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMinLengthChangeInRequestValidator() {\n    return new SchemaMinLengthChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMinPropertiesChangeInRequestValidator() {\n    return new SchemaMinPropertiesChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaUniqueItemsChangeInRequestValidator() {\n    return new SchemaUniqueItemsChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaRequiredChangeInRequestValidator() {\n    return new SchemaRequiredChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaEnumChangeInRequestValidator() {\n    return new SchemaEnumChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaNullableChangeInRequestValidator() {\n    return new SchemaNullableChangeInRequestValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaReadOnlyChangeValidator() {\n    return new SchemaReadOnlyChangeValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaWriteOnlyChangeValidator() {\n    return new SchemaWriteOnlyChangeValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaXmlChangeValidator() {\n    return new SchemaXmlChangeValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaDiscriminatorChangeValidator() {\n    return new SchemaDiscriminatorChangeValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMultipleOfChangeInResponseValidator() {\n    return new SchemaMultipleOfChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMaxItemsChangeInResponseValidator() {\n    return new SchemaMaxItemsChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMaxLengthChangeInResponseValidator() {\n    return new SchemaMaxLengthChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMaxPropertiesChangeInResponseValidator() {\n    return new SchemaMaxPropertiesChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMinimumChangeInResponseValidator() {\n    return new SchemaMinimumChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMinItemsChangeInResponseValidator() {\n    return new SchemaMinItemsChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMinLengthChangeInResponseValidator() {\n    return new SchemaMinLengthChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaMinPropertiesChangeInResponseValidator() {\n    return new SchemaMinPropertiesChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaUniqueItemsChangeInResponseValidator() {\n    return new SchemaUniqueItemsChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaRequiredChangeInResponseValidator() {\n    return new SchemaRequiredChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaEnumChangeInResponseValidator() {\n    return new SchemaEnumChangeInResponseValidator();\n  }\n\n  @Bean\n  public SchemaCompareValidator schemaNullableChangeInResponseValidator() {\n    return new SchemaNullableChangeInResponseValidator();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility-spring/src/main/resources/META-INF/spring.factories",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\norg.springframework.boot.autoconfigure.EnableAutoConfiguration=\\\norg.apache.servicecomb.toolkit.oasv.compatibility.config.EncodingDiffValidatorsConfiguration,\\\norg.apache.servicecomb.toolkit.oasv.compatibility.config.HeaderDiffValidatorsConfiguration,\\\norg.apache.servicecomb.toolkit.oasv.compatibility.config.MediaTypeDiffValidatorsConfiguration,\\\norg.apache.servicecomb.toolkit.oasv.compatibility.config.OperationDiffValidatorsConfiguration,\\\norg.apache.servicecomb.toolkit.oasv.compatibility.config.ParameterDiffValidatorsConfiguration,\\\norg.apache.servicecomb.toolkit.oasv.compatibility.config.PathItemDiffValidatorsConfiguration,\\\norg.apache.servicecomb.toolkit.oasv.compatibility.config.RequestBodyDiffValidatorsConfiguration,\\\norg.apache.servicecomb.toolkit.oasv.compatibility.config.ResponseDiffValidatorsConfiguration,\\\norg.apache.servicecomb.toolkit.oasv.compatibility.config.SchemaDiffValidatorsConfiguration\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility-spring/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/config/ValidatorConfigurationsTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.compatibility.config;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.HeaderDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MediaTypeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OperationDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.PathItemDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.RequestBodyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ResponseDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaDiffValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.BeansException;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.context.ApplicationContext;\nimport org.springframework.context.ApplicationContextAware;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\n@SpringBootApplication\npublic class ValidatorConfigurationsTest implements ApplicationContextAware {\n\n  private ApplicationContext applicationContext;\n\n  @Test\n  public void testConfigurations() {\n    assertThat(applicationContext.getBeansOfType(EncodingDiffValidator.class)).hasSize(7);\n    assertThat(applicationContext.getBeansOfType(HeaderDiffValidator.class)).hasSize(3);\n    assertThat(applicationContext.getBeansOfType(MediaTypeDiffValidator.class)).hasSize(6);\n    assertThat(applicationContext.getBeansOfType(OperationDiffValidator.class)).hasSize(5);\n    assertThat(applicationContext.getBeansOfType(ParameterDiffValidator.class)).hasSize(8);\n    assertThat(applicationContext.getBeansOfType(PathItemDiffValidator.class)).hasSize(3);\n    assertThat(applicationContext.getBeansOfType(RequestBodyDiffValidator.class)).hasSize(2);\n    assertThat(applicationContext.getBeansOfType(ResponseDiffValidator.class)).hasSize(3);\n    assertThat(applicationContext.getBeansOfType(SchemaDiffValidator.class)).hasSize(1);\n  }\n\n  @Override\n  public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\n    this.applicationContext = applicationContext;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-compatibility-spring/src/test/resources/logback-test.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<configuration>\n  <include resource=\"org/springframework/boot/logging/logback/base.xml\" />\n  <logger name=\"org.springframework\" level=\"OFF\"/>\n</configuration>\n"
  },
  {
    "path": "oas-validator/oas-validator-core/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n  <parent>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>oas-validator-parent</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <relativePath>../pom.xml</relativePath>\n  </parent>\n\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>oas-validator-core</artifactId>\n\n  <dependencies>\n\n    <dependency>\n      <groupId>org.apache.commons</groupId>\n      <artifactId>commons-lang3</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.commons</groupId>\n      <artifactId>commons-collections4</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>io.swagger.parser.v3</groupId>\n      <artifactId>swagger-parser</artifactId>\n    </dependency>\n\n    <!-- test deps -->\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-test</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-plugin</artifactId>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-report-plugin</artifactId>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/FactoryOptions.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv;\n\nimport org.apache.commons.lang3.StringUtils;\n\nimport java.util.*;\n\npublic class FactoryOptions {\n\n  private final Map<String, String> options;\n\n  public FactoryOptions(Map<String, String> options) {\n    this.options = Collections.unmodifiableMap(new HashMap<>(options));\n  }\n\n  public FactoryOptions(Properties properties) {\n    Map<String, String> options = new HashMap<>();\n    Set<Object> keys = properties.keySet();\n    for (Object key : keys) {\n      options.put((String) key, (String) properties.get(key));\n    }\n    this.options = Collections.unmodifiableMap(options);\n  }\n\n  public String getString(String key) {\n    String value = options.get(key);\n    if (StringUtils.isNotBlank(value)) {\n      return value;\n    }\n    return null;\n  }\n\n  public Boolean getBoolean(String key) {\n    String value = options.get(key);\n    if (StringUtils.isNotBlank(value)) {\n      return Boolean.valueOf(value);\n    }\n    return null;\n  }\n\n  public Integer getInteger(String key) {\n    String value = options.get(key);\n    if (StringUtils.isNotBlank(value)) {\n      return Integer.valueOf(value);\n    }\n    return null;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/common/OasObjectProperty.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.common;\n\nimport java.util.Objects;\nimport java.util.StringJoiner;\n\n/**\n * OpenAPI V3 object property information\n */\npublic class OasObjectProperty {\n\n  /**\n   * property name\n   */\n  private final String name;\n\n  /**\n   * property object type, if null means primitive types, otherwise means OAS object\n   */\n  private final OasObjectType objectType;\n\n  public OasObjectProperty(String name) {\n    this(null, name);\n  }\n\n  public OasObjectProperty(OasObjectType objectType, String name) {\n    this.objectType = objectType;\n    this.name = name;\n  }\n\n  public OasObjectType getObjectType() {\n    return objectType;\n  }\n\n  public String getName() {\n    return name;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    OasObjectProperty that = (OasObjectProperty) o;\n    return objectType == that.objectType &&\n      Objects.equals(name, that.name);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(objectType, name);\n  }\n\n  @Override\n  public String toString() {\n    return new StringJoiner(\", \", OasObjectProperty.class.getSimpleName() + \"[\", \"]\")\n      .add(\"name='\" + name + \"'\")\n      .add(\"objectType=\" + objectType)\n      .toString();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/common/OasObjectPropertyLocation.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.common;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\n\nimport java.util.*;\n\nimport static java.util.Collections.singletonList;\n\n/**\n * OpenAPI v3 object location\n * <p>本对象immutable</p>\n */\npublic class OasObjectPropertyLocation {\n\n  /**\n   * first element stands for root object\n   * last element stands for current object\n   * this list stands for the path from root to current object\n   */\n  private final List<OasObjectProperty> path;\n\n  private OasObjectPropertyLocation(OasObjectProperty path) {\n    this(singletonList(path));\n  }\n\n  private OasObjectPropertyLocation(List<OasObjectProperty> path) {\n    this.path = Collections.unmodifiableList(path);\n  }\n\n  /**\n   * Create a location for root object\n   *\n   * @return\n   */\n  public static OasObjectPropertyLocation root() {\n    return new OasObjectPropertyLocation(new OasObjectProperty(OasObjectType.OPENAPI, \"$\"));\n  }\n\n  /**\n   * Add property to this location and return a new location\n   *\n   * @param propertyName property name\n   * @param propertyType OAS object type of property\n   * @return a new {@link OasObjectPropertyLocation}，origin {@link OasObjectPropertyLocation} is untouched\n   */\n  public OasObjectPropertyLocation property(String propertyName, OasObjectType propertyType) {\n    ArrayList<OasObjectProperty> oasObjectProperties = new ArrayList<>(path);\n    oasObjectProperties.add(new OasObjectProperty(propertyType, propertyName));\n    return new OasObjectPropertyLocation(oasObjectProperties);\n  }\n\n  /**\n   * Add a non-object(primitive) type property to this location, and return a new location\n   *\n   * @param propertyName property name\n   * @return a new {@link OasObjectPropertyLocation}，origin {@link OasObjectPropertyLocation} is untouched\n   */\n  public OasObjectPropertyLocation property(String propertyName) {\n    ArrayList<OasObjectProperty> oasObjectProperties = new ArrayList<>(path);\n    oasObjectProperties.add(new OasObjectProperty(propertyName));\n    return new OasObjectPropertyLocation(oasObjectProperties);\n  }\n\n  /**\n   * Get a path from root to leaf\n   *\n   * @return\n   */\n  public List<OasObjectProperty> getPath() {\n    return Collections.unmodifiableList(path);\n  }\n\n  /**\n   * Get parent property\n   *\n   * @return\n   */\n  @JsonIgnore\n  public OasObjectProperty getParent() {\n    if (path.size() <= 1) {\n      return null;\n    }\n    return path.get(path.size() - 2);\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    OasObjectPropertyLocation that = (OasObjectPropertyLocation) o;\n    return Objects.equals(path, that.path);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(path);\n  }\n\n  @Override\n  public String toString() {\n    return new StringJoiner(\", \", OasObjectPropertyLocation.class.getSimpleName() + \"[\", \"]\")\n      .add(\"path=\" + path)\n      .toString();\n  }\n\n  public static String toPathString(OasObjectPropertyLocation location) {\n    if (location == null) {\n      return \"\";\n    }\n\n    StringBuilder sb = new StringBuilder();\n    List<OasObjectProperty> path = location.getPath();\n    for (OasObjectProperty property : path) {\n      sb.append(property.getName()).append('.');\n    }\n    sb.deleteCharAt(sb.length() - 1);\n    return sb.toString();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/common/OasObjectType.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.common;\n\n/**\n * OpenAPI v3 Object Type\n * <p>\n * Corresponding to <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schema\">OpenAPI Specification - Schema</a>\n * </p>\n */\npublic enum OasObjectType {\n  OPENAPI,\n  INFO,\n  CONTACT,\n  LICENSE,\n  SERVER,\n  SERVER_VARIABLE,\n  COMPONENTS,\n  PATHS,\n  PATH_ITEM,\n  OPERATION,\n  EXTERNAL_DOCUMENTATION,\n  PARAMETER,\n  REQUEST_BODY,\n  MEDIA_TYPE,\n  ENCODING,\n  RESPONSES,\n  RESPONSE,\n  CALLBACK,\n  EXAMPLE,\n  HEADER,\n  TAG,\n  REFERENCE,\n  SCHEMA,\n  DISCRIMINATOR,\n  XML,\n  SECURITY_SCHEME,\n  OAUTH_FLOWS,\n  OAUTH_FLOW,\n  LINK,\n  SECURITY_REQUIREMENT\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/CallbackDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.callbacks.Callback;\n\npublic interface CallbackDiffValidator extends OasObjectDiffValidator<Callback> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/ComponentsDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.Components;\n\npublic interface ComponentsDiffValidator extends OasObjectDiffValidator<Components> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/DefaultOasSpecDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport io.swagger.v3.oas.models.OpenAPI;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport static java.util.stream.Collectors.toList;\n\npublic class DefaultOasSpecDiffValidator implements OasSpecDiffValidator {\n\n  private final List<OpenApiDiffValidator> openApiDiffValidators;\n\n  public DefaultOasSpecDiffValidator(List<OpenApiDiffValidator> openApiDiffValidators) {\n    this.openApiDiffValidators = new ArrayList<>(openApiDiffValidators);\n  }\n\n  @Override\n  public List<OasDiffViolation> validate(OasDiffValidationContext context, OpenAPI leftOpenApi, OpenAPI rightOpenApi) {\n\n    OasObjectPropertyLocation leftRoot = OasObjectPropertyLocation.root();\n    OasObjectPropertyLocation rightRoot = OasObjectPropertyLocation.root();\n\n    return openApiDiffValidators\n      .stream()\n      .map(validator -> validator.validate(context, leftRoot, leftOpenApi, rightRoot, rightOpenApi))\n      .flatMap(list -> list.stream())\n      .collect(toList());\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/DiffViolationMessages.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\npublic abstract class DiffViolationMessages {\n\n  public static final String OP_DEL_FORBIDDEN = \"deletion is no allowed on right side\";\n  public static final String OP_ADD_FORBIDDEN = \"adding is not allowed on right side\";\n\n  public static final String NEW_NOT_EQ_OLD = \"not equal on both side\";\n  public static final String NEW_NOT_GTE_OLD = \"left side must be >= right side\";\n  public static final String NEW_NOT_LTE_OLD = \"left side must be <= right side\";\n\n  public static final String FALSE_TO_TRUE = \"only false->true is allowed\";\n  public static final String TRUE_TO_FALSE = \"only true->false is allowed\";\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/EncodingDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.media.Encoding;\n\npublic interface EncodingDiffValidator extends OasObjectDiffValidator<Encoding> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/HeaderDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.headers.Header;\n\npublic interface HeaderDiffValidator extends OasObjectDiffValidator<Header> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/InfoDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.info.Info;\n\npublic interface InfoDiffValidator extends OasObjectDiffValidator<Info> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/LinkDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.links.Link;\n\npublic interface LinkDiffValidator extends OasObjectDiffValidator<Link> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/ListPropertyDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\n\nimport java.util.List;\nimport java.util.function.Function;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasObjectDiffValidatorUtils.doDiffValidateListProperty;\n\npublic abstract class ListPropertyDiffValidator<T, P>\n  extends OasObjectDiffValidatorTemplate<T> {\n\n  private final List<? extends OasObjectDiffValidator<P>> elementDiffValidators;\n\n  private final Function<P, ?> elementKeyMapper;\n\n  protected ListPropertyDiffValidator(\n    List<? extends OasObjectDiffValidator<P>> elementDiffValidators,\n    Function<P, Object> elementKeyMapper) {\n    this.elementDiffValidators = elementDiffValidators;\n    this.elementKeyMapper = elementKeyMapper;\n  }\n\n  @Override\n  public List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, T leftOasObject,\n    OasObjectPropertyLocation rightLocation, T rightOasObject) {\n\n    return doDiffValidateListProperty(\n      context,\n      getListPropertyName(),\n      leftLocation,\n      getListProperty(leftOasObject),\n      rightLocation,\n      getListProperty(rightOasObject),\n      getElementType(),\n      elementKeyMapper,\n      elementDiffValidators\n    );\n\n  }\n\n  protected abstract List<P> getListProperty(T oasObject);\n\n  protected abstract String getListPropertyName();\n\n  protected abstract OasObjectType getElementType();\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/MapPropertyDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasObjectDiffValidatorUtils.doDiffValidateMapProperty;\n\npublic abstract class MapPropertyDiffValidator<T, P>\n  extends OasObjectDiffValidatorTemplate<T> {\n\n  private final List<? extends OasObjectDiffValidator<P>> valueDiffValidators;\n\n  protected MapPropertyDiffValidator(List<? extends OasObjectDiffValidator<P>> valueDiffValidators) {\n    this.valueDiffValidators = valueDiffValidators;\n  }\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, T leftOasObject, OasObjectPropertyLocation rightLocation,\n    T rightOasObject) {\n\n    return doDiffValidateMapProperty(\n      context,\n      getMapPropertyName(),\n      leftLocation,\n      getMapProperty(leftOasObject),\n      rightLocation,\n      getMapProperty(rightOasObject),\n      getValueType(),\n      valueDiffValidators\n    );\n\n  }\n\n  protected abstract Map<String, P> getMapProperty(T oasObject);\n\n  protected abstract String getMapPropertyName();\n\n  protected abstract OasObjectType getValueType();\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/MediaTypeDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.media.MediaType;\n\npublic interface MediaTypeDiffValidator extends OasObjectDiffValidator<MediaType> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/OasDiffValidationContext.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.OpenAPI;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class OasDiffValidationContext {\n\n  private final OpenAPI leftOpenAPI;\n\n  private final OpenAPI rightOpenAPI;\n\n  private final Map<String, Object> attributes = new HashMap<>();\n\n  public OasDiffValidationContext(OpenAPI leftOpenAPI, OpenAPI rightOpenAPI) {\n    this.leftOpenAPI = leftOpenAPI;\n    this.rightOpenAPI = rightOpenAPI;\n  }\n\n  public OpenAPI getLeftOpenAPI() {\n    return leftOpenAPI;\n  }\n\n  public OpenAPI getRightOpenAPI() {\n    return rightOpenAPI;\n  }\n\n  public <T> T getAttribute(String name) {\n    return (T) attributes.get(name);\n  }\n\n  public <T> void setAttribute(String name, T attr) {\n    this.attributes.put(name, attr);\n  }\n\n  public void removeAttribute(String name) {\n    this.attributes.remove(name);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/OasDiffValidationException.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\npublic class OasDiffValidationException extends RuntimeException {\n  public OasDiffValidationException() {\n  }\n\n  public OasDiffValidationException(String message) {\n    super(message);\n  }\n\n  public OasDiffValidationException(String message, Throwable cause) {\n    super(message, cause);\n  }\n\n  public OasDiffValidationException(Throwable cause) {\n    super(cause);\n  }\n\n  public OasDiffValidationException(String message, Throwable cause, boolean enableSuppression,\n    boolean writableStackTrace) {\n    super(message, cause, enableSuppression, writableStackTrace);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/OasDiffViolation.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\n\nimport java.util.Objects;\nimport java.util.StringJoiner;\n\npublic class OasDiffViolation {\n\n  /**\n   * left OAS object location\n   */\n  private final OasObjectPropertyLocation leftLocation;\n\n  /**\n   * right OAS object location\n   */\n  private final OasObjectPropertyLocation rightLocation;\n\n  private final String error;\n\n  public static OasDiffViolation onlyLeft(OasObjectPropertyLocation location, String error) {\n    return new OasDiffViolation(location, null, error);\n  }\n\n  public static OasDiffViolation onlyRight(OasObjectPropertyLocation location, String error) {\n    return new OasDiffViolation(null, location, error);\n  }\n\n  public OasDiffViolation(OasObjectPropertyLocation leftLocation,\n    OasObjectPropertyLocation rightLocation, String error) {\n    this.leftLocation = leftLocation;\n    this.rightLocation = rightLocation;\n    this.error = error;\n  }\n\n  public OasObjectPropertyLocation getLeftLocation() {\n    return leftLocation;\n  }\n\n  public OasObjectPropertyLocation getRightLocation() {\n    return rightLocation;\n  }\n\n  public String getError() {\n    return error;\n  }\n\n  @Override\n  public String toString() {\n    return new StringJoiner(\", \", OasDiffViolation.class.getSimpleName() + \"[\", \"]\")\n      .add(\"leftLocation=\" + leftLocation)\n      .add(\"rightLocation=\" + rightLocation)\n      .add(\"error='\" + error + \"'\")\n      .toString();\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    OasDiffViolation that = (OasDiffViolation) o;\n    return Objects.equals(leftLocation, that.leftLocation) &&\n      Objects.equals(rightLocation, that.rightLocation) &&\n      Objects.equals(error, that.error);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(leftLocation, rightLocation, error);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/OasObjectDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\n\nimport java.util.List;\n\n/**\n * OAS Object difference validator interface\n *\n * @param <T> <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#table-of-contents\">OpenAPI Specification</a> Object\n */\npublic interface OasObjectDiffValidator<T> {\n\n  /**\n   * leftOasObject and rightOasObject should not be null at the same time\n   *\n   * @param context        difference validation context\n   * @param leftLocation   left OAS Object location (maybe null)\n   * @param leftOasObject  left OAS Object (maybe null)\n   * @param rightLocation  right OAS Object location (maybe null)\n   * @param rightOasObject right OAS Object (maybe null)\n   * @return difference validation violations, maybe a empty list\n   */\n  List<OasDiffViolation> validate(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, T leftOasObject,\n    OasObjectPropertyLocation rightLocation, T rightOasObject);\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/OasObjectDiffValidatorTemplate.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasObjectDiffValidatorUtils.assertNullGood;\nimport static java.util.Collections.emptyList;\n\npublic class OasObjectDiffValidatorTemplate<T> implements OasObjectDiffValidator<T> {\n\n  @Override\n  public List<OasDiffViolation> validate(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, T leftOasObject,\n    OasObjectPropertyLocation rightLocation, T rightOasObject) {\n\n    assertNullGood(leftLocation, leftOasObject, rightLocation, rightOasObject);\n    if (leftOasObject == null && rightOasObject != null) {\n      return validateAdd(context, rightLocation, rightOasObject);\n    }\n    if (leftOasObject != null && rightOasObject == null) {\n      return validateDel(context, leftLocation, leftOasObject);\n    }\n    return validateCompare(context, leftLocation, leftOasObject, rightLocation, rightOasObject);\n  }\n\n  /**\n   * validate the adding situation, left side doesn't exist but right side exists\n   *\n   * @param context\n   * @param rightLocation\n   * @param rightOasObject\n   * @return\n   */\n  protected List<OasDiffViolation> validateAdd(OasDiffValidationContext context, OasObjectPropertyLocation rightLocation,\n    T rightOasObject) {\n    return emptyList();\n  }\n\n  /**\n   * validate the deleting situation, left side exists but right side doesn't exist\n   *\n   * @param context\n   * @param leftLocation\n   * @param leftOasObject\n   * @return\n   */\n  protected List<OasDiffViolation> validateDel(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    T leftOasObject) {\n    return emptyList();\n  }\n\n  /**\n   * validate the modification situation, both left side and right side right exists.\n   * notice that left maybe equals to right\n   *\n   * @param context\n   * @param leftLocation\n   * @param leftOasObject\n   * @param rightLocation\n   * @param rightOasObject\n   * @return\n   */\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, T leftOasObject,\n    OasObjectPropertyLocation rightLocation, T rightOasObject) {\n    return emptyList();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/OasSpecDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.OpenAPI;\n\nimport java.util.List;\n\n/**\n * OAS Spec difference validator\n */\npublic interface OasSpecDiffValidator {\n\n  List<OasDiffViolation> validate(OasDiffValidationContext context, OpenAPI leftOpenApi, OpenAPI rightOpenApi);\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/ObjectPropertyDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasObjectDiffValidatorUtils.doDiffValidateProperty;\n\n/**\n * OAS Object object property difference validator\n *\n * @param <T> Object defined in <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#table-of-contents\">OpenAPI Specification</a>\n * @param <P> Property type\n */\npublic abstract class ObjectPropertyDiffValidator<T, P>\n  extends OasObjectDiffValidatorTemplate<T> {\n\n  private final List<? extends OasObjectDiffValidator<P>> diffValidators;\n\n  protected ObjectPropertyDiffValidator(List<? extends OasObjectDiffValidator<P>> diffValidators) {\n    this.diffValidators = diffValidators;\n  }\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, T leftOasObject, OasObjectPropertyLocation rightLocation,\n    T rightOasObject) {\n\n    P leftProperty = getPropertyObject(leftOasObject);\n    P rightProperty = getPropertyObject(rightOasObject);\n\n    OasObjectPropertyLocation leftPropertyLoc =\n      leftProperty == null ? null : leftLocation.property(getPropertyName(), getPropertyType());\n    OasObjectPropertyLocation rightPropertyLoc =\n      rightProperty == null ? null : rightLocation.property(getPropertyName(), getPropertyType());\n\n    return doDiffValidateProperty(context, leftPropertyLoc, leftProperty, rightPropertyLoc, rightProperty,\n      diffValidators);\n\n  }\n\n  /**\n   * @param oasObject will never be null\n   * @return\n   */\n  protected abstract P getPropertyObject(T oasObject);\n\n  protected abstract String getPropertyName();\n\n  protected abstract OasObjectType getPropertyType();\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/OpenApiDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.OpenAPI;\n\npublic interface OpenApiDiffValidator extends OasObjectDiffValidator<OpenAPI> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/OperationDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.Operation;\n\npublic interface OperationDiffValidator extends OasObjectDiffValidator<Operation> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/ParameterDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\npublic interface ParameterDiffValidator extends OasObjectDiffValidator<Parameter> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/PathItemDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.PathItem;\n\npublic interface PathItemDiffValidator extends OasObjectDiffValidator<PathItem> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/PathsDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.Paths;\n\npublic interface PathsDiffValidator extends OasObjectDiffValidator<Paths> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/RequestBodyDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.parameters.RequestBody;\n\npublic interface RequestBodyDiffValidator extends OasObjectDiffValidator<RequestBody> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/ResponseDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.responses.ApiResponse;\n\npublic interface ResponseDiffValidator extends OasObjectDiffValidator<ApiResponse> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/ResponsesDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.responses.ApiResponses;\n\npublic interface ResponsesDiffValidator extends OasObjectDiffValidator<ApiResponses> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/SchemaAddValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.util.List;\n\npublic interface SchemaAddValidator {\n\n  /**\n   * validate the adding situation, left side not exist but right side exists\n   *\n   * @param context\n   * @param rightLocation\n   * @param rightOasObject added schema object\n   * @return\n   */\n  List<OasDiffViolation> validate(OasDiffValidationContext context, OasObjectPropertyLocation rightLocation,\n    Schema rightOasObject);\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/SchemaCompareValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.schema.SchemaDiffValidatorEngine;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.util.List;\n\npublic interface SchemaCompareValidator {\n\n  /**\n   * validate the modification situation, both left side and right side right exists.\n   * <p>\n   * there is no need to check <code>allOf, anyOf, oneOf, items, properties</code>\n   * </p>\n   * they will be recursively checked by {@link SchemaDiffValidatorEngine}\n   *\n   * @param context\n   * @param leftLocation\n   * @param leftOasObject\n   * @param rightLocation\n   * @param rightOasObject\n   * @return\n   */\n  List<OasDiffViolation> validate(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Schema leftOasObject,\n    OasObjectPropertyLocation rightLocation, Schema rightOasObject);\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/SchemaDelValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.util.List;\n\npublic interface SchemaDelValidator {\n\n  /**\n   * validate the deleting situation, left side exists but right side not exist\n   *\n   * @param context\n   * @param leftLocation\n   * @param leftOasObject deleted schema object\n   * @return\n   */\n  List<OasDiffViolation> validate(\n    OasDiffValidationContext context, OasObjectPropertyLocation leftLocation, Schema leftOasObject);\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/SchemaDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.media.Schema;\n\npublic interface SchemaDiffValidator extends OasObjectDiffValidator<Schema> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/SecuritySchemeDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.security.SecurityScheme;\n\npublic interface SecuritySchemeDiffValidator extends OasObjectDiffValidator<SecurityScheme> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/ServerDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.servers.Server;\n\npublic interface ServerDiffValidator extends OasObjectDiffValidator<Server> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/api/TagDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.api;\n\nimport io.swagger.v3.oas.models.tags.Tag;\n\npublic interface TagDiffValidator extends OasObjectDiffValidator<Tag> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/CallbackDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.CallbackDiffValidator;\n\npublic interface CallbackDiffValidatorFactory extends OasObjectDiffValidatorFactory<CallbackDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/ComponentsDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ComponentsDiffValidator;\n\npublic interface ComponentsDiffValidatorFactory extends OasObjectDiffValidatorFactory<ComponentsDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/EncodingDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\n\npublic interface EncodingDiffValidatorFactory extends OasObjectDiffValidatorFactory<EncodingDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/HeaderDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.HeaderDiffValidator;\n\npublic interface HeaderDiffValidatorFactory extends OasObjectDiffValidatorFactory<HeaderDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/InfoDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.InfoDiffValidator;\n\npublic interface InfoDiffValidatorFactory extends OasObjectDiffValidatorFactory<InfoDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/LinkDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.LinkDiffValidator;\n\npublic interface LinkDiffValidatorFactory extends OasObjectDiffValidatorFactory<LinkDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/MediaTypeDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MediaTypeDiffValidator;\n\npublic interface MediaTypeDiffValidatorFactory extends OasObjectDiffValidatorFactory<MediaTypeDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/OasObjectDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasObjectDiffValidator;\n\npublic interface OasObjectDiffValidatorFactory<T extends OasObjectDiffValidator> {\n\n  List<T> create();\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/OasSpecDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasSpecDiffValidator;\n\npublic interface OasSpecDiffValidatorFactory {\n\n  OasSpecDiffValidator create();\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/OpenApiDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OpenApiDiffValidator;\n\npublic interface OpenApiDiffValidatorFactory extends OasObjectDiffValidatorFactory<OpenApiDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/OperationDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OperationDiffValidator;\n\npublic interface OperationDiffValidatorFactory extends OasObjectDiffValidatorFactory<OperationDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/ParameterDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\n\npublic interface ParameterDiffValidatorFactory extends OasObjectDiffValidatorFactory<ParameterDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/PathItemDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.PathItemDiffValidator;\n\npublic interface PathItemDiffValidatorFactory extends OasObjectDiffValidatorFactory<PathItemDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/PathsDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.PathsDiffValidator;\n\npublic interface PathsDiffValidatorFactory extends OasObjectDiffValidatorFactory<PathsDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/RequestBodyDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.RequestBodyDiffValidator;\n\npublic interface RequestBodyDiffValidatorFactory extends OasObjectDiffValidatorFactory<RequestBodyDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/ResponseDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ResponseDiffValidator;\n\npublic interface ResponseDiffValidatorFactory extends OasObjectDiffValidatorFactory<ResponseDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/ResponsesDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ResponsesDiffValidator;\n\npublic interface ResponsesDiffValidatorFactory extends OasObjectDiffValidatorFactory<ResponsesDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/SchemaDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaDiffValidator;\n\npublic interface SchemaDiffValidatorFactory extends OasObjectDiffValidatorFactory<SchemaDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/SecuritySchemeDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SecuritySchemeDiffValidator;\n\npublic interface SecuritySchemeDiffValidatorFactory extends OasObjectDiffValidatorFactory<SecuritySchemeDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/ServerDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ServerDiffValidator;\n\npublic interface ServerDiffValidatorFactory extends OasObjectDiffValidatorFactory<ServerDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/TagDiffValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.TagDiffValidator;\n\npublic interface TagDiffValidatorFactory extends OasObjectDiffValidatorFactory<TagDiffValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/components/ComponentsCallbacksDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.CallbackDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ComponentsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MapPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.callbacks.Callback;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.CALLBACK;\n\npublic class ComponentsCallbacksDiffValidator\n  extends MapPropertyDiffValidator<Components, Callback>\n  implements ComponentsDiffValidator {\n\n  public ComponentsCallbacksDiffValidator(List<CallbackDiffValidator> diffValidators) {\n    super(diffValidators);\n  }\n\n  @Override\n  protected Map<String, Callback> getMapProperty(Components oasObject) {\n    return oasObject.getCallbacks();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"callbacks\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return CALLBACK;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/components/ComponentsHeadersDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ComponentsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.HeaderDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MapPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.headers.Header;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.HEADER;\n\npublic class ComponentsHeadersDiffValidator\n  extends MapPropertyDiffValidator<Components, Header>\n  implements ComponentsDiffValidator {\n\n  public ComponentsHeadersDiffValidator(List<HeaderDiffValidator> diffValidators) {\n    super(diffValidators);\n  }\n\n  @Override\n  protected Map<String, Header> getMapProperty(Components oasObject) {\n    return oasObject.getHeaders();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"headers\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return HEADER;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/components/ComponentsLinksDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ComponentsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.LinkDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MapPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.links.Link;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.LINK;\n\npublic class ComponentsLinksDiffValidator\n  extends MapPropertyDiffValidator<Components, Link>\n  implements ComponentsDiffValidator {\n\n  public ComponentsLinksDiffValidator(List<LinkDiffValidator> diffValidators) {\n    super(diffValidators);\n  }\n\n  @Override\n  protected Map<String, Link> getMapProperty(Components oasObject) {\n    return oasObject.getLinks();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"links\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return LINK;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/components/ComponentsParametersDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ComponentsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MapPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PARAMETER;\n\npublic class ComponentsParametersDiffValidator\n  extends MapPropertyDiffValidator<Components, Parameter>\n  implements ComponentsDiffValidator {\n\n  public ComponentsParametersDiffValidator(List<ParameterDiffValidator> diffValidators) {\n    super(diffValidators);\n  }\n\n  @Override\n  protected Map<String, Parameter> getMapProperty(Components oasObject) {\n    return oasObject.getParameters();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"parameters\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return PARAMETER;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/components/ComponentsRequestBodiesDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ComponentsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MapPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.RequestBodyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.parameters.RequestBody;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.REQUEST_BODY;\n\npublic class ComponentsRequestBodiesDiffValidator\n  extends MapPropertyDiffValidator<Components, RequestBody>\n  implements ComponentsDiffValidator {\n\n  public ComponentsRequestBodiesDiffValidator(List<RequestBodyDiffValidator> diffValidators) {\n    super(diffValidators);\n  }\n\n  @Override\n  protected Map<String, RequestBody> getMapProperty(Components oasObject) {\n    return oasObject.getRequestBodies();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"requestBodies\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return REQUEST_BODY;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/components/ComponentsResponsesDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ComponentsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MapPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ResponseDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.responses.ApiResponse;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.RESPONSE;\n\npublic class ComponentsResponsesDiffValidator\n  extends MapPropertyDiffValidator<Components, ApiResponse>\n  implements ComponentsDiffValidator {\n\n  public ComponentsResponsesDiffValidator(List<ResponseDiffValidator> diffValidators) {\n    super(diffValidators);\n  }\n\n  @Override\n  protected Map<String, ApiResponse> getMapProperty(Components oasObject) {\n    return oasObject.getResponses();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"responses\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return RESPONSE;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/encoding/EncodingHeadersDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.HeaderDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MapPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.headers.Header;\nimport io.swagger.v3.oas.models.media.Encoding;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.HEADER;\n\npublic class EncodingHeadersDiffValidator\n  extends MapPropertyDiffValidator<Encoding, Header>\n  implements EncodingDiffValidator {\n\n  public EncodingHeadersDiffValidator(List<HeaderDiffValidator> diffValidators) {\n    super(diffValidators);\n  }\n\n  @Override\n  protected Map<String, Header> getMapProperty(Encoding oasObject) {\n    return oasObject.getHeaders();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"headers\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return HEADER;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/header/HeaderSchemaDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.header;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.HeaderDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ObjectPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.headers.Header;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SCHEMA;\n\npublic class HeaderSchemaDiffValidator\n  extends ObjectPropertyDiffValidator<Header, Schema>\n  implements HeaderDiffValidator {\n\n  public HeaderSchemaDiffValidator(List<SchemaDiffValidator> oasObjectValidators) {\n    super(oasObjectValidators);\n  }\n\n  @Override\n  protected Schema getPropertyObject(Header oasObject) {\n    return oasObject.getSchema();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"schema\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return SCHEMA;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/mediatype/MediaTypeEncodingDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.mediatype;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.media.Encoding;\nimport io.swagger.v3.oas.models.media.MediaType;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.ENCODING;\n\npublic class MediaTypeEncodingDiffValidator\n  extends MapPropertyDiffValidator<MediaType, Encoding>\n  implements MediaTypeDiffValidator {\n\n  public MediaTypeEncodingDiffValidator(List<EncodingDiffValidator> diffValidators) {\n    super(diffValidators);\n  }\n\n  @Override\n  public List<OasDiffViolation> validate(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    MediaType leftOasObject, OasObjectPropertyLocation rightLocation, MediaType rightOasObject) {\n\n    List<OasDiffViolation> violations = super\n      .validate(context, leftLocation, leftOasObject, rightLocation, rightOasObject);\n\n    return violations;\n  }\n\n  @Override\n  protected Map<String, Encoding> getMapProperty(MediaType oasObject) {\n    return oasObject.getEncoding();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"encoding\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return ENCODING;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/mediatype/MediaTypeSchemaDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.mediatype;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MediaTypeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ObjectPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.media.MediaType;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SCHEMA;\n\npublic class MediaTypeSchemaDiffValidator\n  extends ObjectPropertyDiffValidator<MediaType, Schema> implements\n  MediaTypeDiffValidator {\n\n  public MediaTypeSchemaDiffValidator(List<SchemaDiffValidator> oasObjectValidators) {\n    super(oasObjectValidators);\n  }\n\n  @Override\n  protected Schema getPropertyObject(MediaType oasObject) {\n    return oasObject.getSchema();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"schema\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return SCHEMA;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/openapi/OpenApiComponentsDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ComponentsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ObjectPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OpenApiDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.OpenAPI;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.COMPONENTS;\n\npublic class OpenApiComponentsDiffValidator\n  extends ObjectPropertyDiffValidator<OpenAPI, Components>\n  implements OpenApiDiffValidator {\n\n  public OpenApiComponentsDiffValidator(\n    List<ComponentsDiffValidator> componentsDiffValidators) {\n    super(componentsDiffValidators);\n  }\n\n  @Override\n  protected Components getPropertyObject(OpenAPI oasObject) {\n    return oasObject.getComponents();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"components\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return COMPONENTS;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/openapi/OpenApiInfoDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.InfoDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ObjectPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OpenApiDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.info.Info;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.INFO;\n\npublic class OpenApiInfoDiffValidator\n  extends ObjectPropertyDiffValidator<OpenAPI, Info>\n  implements OpenApiDiffValidator {\n\n  public OpenApiInfoDiffValidator(List<InfoDiffValidator> pathsDiffValidators) {\n    super(pathsDiffValidators);\n  }\n\n  @Override\n  protected Info getPropertyObject(OpenAPI oasObject) {\n    return oasObject.getInfo();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"info\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return INFO;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/openapi/OpenApiPathsDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ObjectPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OpenApiDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.PathsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.Paths;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PATHS;\n\npublic class OpenApiPathsDiffValidator\n  extends ObjectPropertyDiffValidator<OpenAPI, Paths>\n  implements OpenApiDiffValidator {\n\n  public OpenApiPathsDiffValidator(List<PathsDiffValidator> pathsDiffValidators) {\n    super(pathsDiffValidators);\n  }\n\n  @Override\n  protected Paths getPropertyObject(OpenAPI oasObject) {\n    return oasObject.getPaths();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"paths\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return PATHS;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/openapi/OpenApiServersDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ListPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OpenApiDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ServerDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.servers.Server;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SERVER;\n\npublic class OpenApiServersDiffValidator\n  extends ListPropertyDiffValidator<OpenAPI, Server>\n  implements OpenApiDiffValidator {\n\n  public OpenApiServersDiffValidator(List<ServerDiffValidator> diffValidators) {\n    super(diffValidators, server -> server.getUrl());\n  }\n\n  @Override\n  protected List<Server> getListProperty(OpenAPI oasObject) {\n    return oasObject.getServers();\n  }\n\n  @Override\n  protected String getListPropertyName() {\n    return \"servers\";\n  }\n\n  @Override\n  protected OasObjectType getElementType() {\n    return SERVER;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/openapi/OpenApiTagsDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ListPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OpenApiDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.TagDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.tags.Tag;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.TAG;\n\npublic class OpenApiTagsDiffValidator\n  extends ListPropertyDiffValidator<OpenAPI, Tag>\n  implements OpenApiDiffValidator {\n\n  public OpenApiTagsDiffValidator(List<TagDiffValidator> diffValidators) {\n    super(diffValidators, tag -> tag.getName());\n  }\n\n  @Override\n  protected List<Tag> getListProperty(OpenAPI oasObject) {\n    return oasObject.getTags();\n  }\n\n  @Override\n  protected String getListPropertyName() {\n    return \"tags\";\n  }\n\n  @Override\n  protected OasObjectType getElementType() {\n    return TAG;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/operation/OperationParametersDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.operation;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ListPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OperationDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport io.swagger.v3.oas.models.Operation;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PARAMETER;\n\npublic class OperationParametersDiffValidator\n  extends ListPropertyDiffValidator<Operation, Parameter>\n  implements OperationDiffValidator {\n\n  public OperationParametersDiffValidator(List<ParameterDiffValidator> parameterValidators) {\n    super(parameterValidators, parameter -> \"in:\" + parameter.getIn() + \"/name:\" + parameter.getName());\n  }\n\n  @Override\n  protected List<Parameter> getListProperty(Operation oasObject) {\n    return oasObject.getParameters();\n  }\n\n  protected String getListPropertyName() {\n    return \"parameters\";\n  }\n\n  protected OasObjectType getElementType() {\n    return PARAMETER;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/operation/OperationRequestBodyDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.operation;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ObjectPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OperationDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.RequestBodyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.Operation;\nimport io.swagger.v3.oas.models.parameters.RequestBody;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.REQUEST_BODY;\n\npublic class OperationRequestBodyDiffValidator\n  extends ObjectPropertyDiffValidator<Operation, RequestBody>\n  implements OperationDiffValidator {\n\n  public OperationRequestBodyDiffValidator(\n    List<RequestBodyDiffValidator> requestBodyDiffValidators) {\n    super(requestBodyDiffValidators);\n  }\n\n  @Override\n  protected RequestBody getPropertyObject(Operation oasObject) {\n    return oasObject.getRequestBody();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"requestBody\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return REQUEST_BODY;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/operation/OperationResponsesDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.operation;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ObjectPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OperationDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ResponsesDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.Operation;\nimport io.swagger.v3.oas.models.responses.ApiResponses;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.RESPONSES;\n\npublic class OperationResponsesDiffValidator\n  extends ObjectPropertyDiffValidator<Operation, ApiResponses>\n  implements OperationDiffValidator {\n\n  public OperationResponsesDiffValidator(List<ResponsesDiffValidator> responsesDiffValidators) {\n    super(responsesDiffValidators);\n  }\n\n  @Override\n  protected ApiResponses getPropertyObject(Operation oasObject) {\n    return oasObject.getResponses();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"responses\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return RESPONSES;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/parameter/ParameterContentDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.media.MediaType;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.MEDIA_TYPE;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.*;\n\npublic class ParameterContentDiffValidator\n  extends MapPropertyDiffValidator<Parameter, MediaType>\n  implements ParameterDiffValidator {\n\n  public ParameterContentDiffValidator(List<MediaTypeDiffValidator> mediaTypeValidators) {\n    super(mediaTypeValidators);\n  }\n\n  @Override\n  public List<OasDiffViolation> validate(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    Parameter leftOasObject, OasObjectPropertyLocation rightLocation, Parameter rightOasObject) {\n\n    enterParameter(context);\n\n    List<OasDiffViolation> violations = super\n      .validate(context, leftLocation, leftOasObject, rightLocation, rightOasObject);\n\n    leaveParameter(context);\n    return violations;\n  }\n\n  @Override\n  protected Map<String, MediaType> getMapProperty(Parameter oasObject) {\n    return oasObject.getContent();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"content\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return MEDIA_TYPE;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/parameter/ParameterSchemaDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.media.Schema;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SCHEMA;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.*;\n\npublic class ParameterSchemaDiffValidator\n  extends ObjectPropertyDiffValidator<Parameter, Schema>\n  implements ParameterDiffValidator {\n\n  public ParameterSchemaDiffValidator(List<SchemaDiffValidator> schemaDiffValidators) {\n    super(schemaDiffValidators);\n  }\n\n  @Override\n  public List<OasDiffViolation> validate(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    Parameter leftOasObject, OasObjectPropertyLocation rightLocation, Parameter rightOasObject) {\n\n    enterParameter(context);\n\n    List<OasDiffViolation> violations = super\n      .validate(context, leftLocation, leftOasObject, rightLocation, rightOasObject);\n\n    leaveParameter(context);\n    return violations;\n  }\n\n  @Override\n  protected Schema getPropertyObject(Parameter oasObject) {\n    return oasObject.getSchema();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"schema\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return SCHEMA;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/pathitem/PathItemOperationsDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.pathitem;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils;\nimport io.swagger.v3.oas.models.Operation;\nimport io.swagger.v3.oas.models.PathItem;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.OPERATION;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasObjectDiffValidatorUtils.doDiffValidateProperty;\n\npublic class PathItemOperationsDiffValidator\n  extends OasObjectDiffValidatorTemplate<PathItem>\n  implements PathItemDiffValidator {\n\n  private final List<OperationDiffValidator> operationValidators;\n\n  public PathItemOperationsDiffValidator(List<OperationDiffValidator> operationValidators) {\n    this.operationValidators = operationValidators;\n  }\n\n  @Override\n  public List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, PathItem leftOasObject,\n    OasObjectPropertyLocation rightLocation, PathItem rightOasObject) {\n\n    Map<PathItem.HttpMethod, Operation> leftOperationMap = leftOasObject.readOperationsMap();\n    Map<PathItem.HttpMethod, Operation> rightOperationMap = rightOasObject.readOperationsMap();\n\n    List<OasDiffViolation> violations = new ArrayList<>();\n\n    for (Map.Entry<PathItem.HttpMethod, Operation> entry : leftOperationMap.entrySet()) {\n      PathItem.HttpMethod leftMethod = entry.getKey();\n      Operation leftOperation = entry.getValue();\n      OasObjectPropertyLocation leftOperationLoc = leftLocation\n        .property(leftMethod.toString().toLowerCase(), OPERATION);\n\n      Operation rightOperation = rightOperationMap.get(leftMethod);\n      if (rightOperation == null) {\n\n        violations.addAll(\n          doDiffValidateProperty(\n            context,\n            leftOperationLoc,\n            leftOperation,\n            null,\n            null,\n            operationValidators\n          )\n        );\n\n      } else {\n\n        OasObjectPropertyLocation rightOperationLoc = rightLocation\n          .property(leftMethod.toString().toLowerCase(), OPERATION);\n        violations.addAll(\n          doDiffValidateProperty(\n            context,\n            leftOperationLoc,\n            leftOperation,\n            rightOperationLoc,\n            rightOperation,\n            operationValidators\n          )\n        );\n\n      }\n\n    }\n\n    for (Map.Entry<PathItem.HttpMethod, Operation> entry : rightOperationMap.entrySet()) {\n      PathItem.HttpMethod rightMethod = entry.getKey();\n      if (leftOperationMap.containsKey(rightMethod)) {\n        continue;\n      }\n      Operation rightOperation = rightOperationMap.get(rightMethod);\n      OasObjectPropertyLocation rightOperationLoc = rightLocation\n        .property(rightMethod.toString().toLowerCase(), OPERATION);\n\n      violations.addAll(\n        doDiffValidateProperty(\n          context,\n          null,\n          null,\n          rightOperationLoc,\n          rightOperation,\n          operationValidators\n        )\n      );\n\n    }\n\n    return violations;\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/pathitem/PathItemParametersDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.pathitem;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ListPropertyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.PathItemDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.PathItem;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PARAMETER;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathItemObject\">Path Item Object</a>\n * .parameters (List of <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject\">Parameter Object</a>)的校验器\n */\npublic class PathItemParametersDiffValidator\n  extends ListPropertyDiffValidator<PathItem, Parameter>\n  implements PathItemDiffValidator {\n\n  public PathItemParametersDiffValidator(List<ParameterDiffValidator> parameterValidators) {\n    super(parameterValidators, parameter -> \"in:\" + parameter.getIn() + \"/name:\" + parameter.getName());\n  }\n\n  @Override\n  protected List<Parameter> getListProperty(PathItem oasObject) {\n    return oasObject.getParameters();\n  }\n\n  @Override\n  protected String getListPropertyName() {\n    return \"parameters\";\n  }\n\n  @Override\n  protected OasObjectType getElementType() {\n    return PARAMETER;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/paths/PathsPathItemsDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.paths;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport io.swagger.v3.oas.models.PathItem;\nimport io.swagger.v3.oas.models.Paths;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasObjectDiffValidatorUtils.doDiffValidateProperty;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PATH_ITEM;\n\npublic class PathsPathItemsDiffValidator\n  extends OasObjectDiffValidatorTemplate<Paths>\n  implements PathsDiffValidator {\n\n  private final List<PathItemDiffValidator> pathItemValidators;\n\n  public PathsPathItemsDiffValidator(List<PathItemDiffValidator> pathItemValidators) {\n    this.pathItemValidators = pathItemValidators;\n  }\n\n  @Override\n  public List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Paths leftOasObject,\n    OasObjectPropertyLocation rightLocation, Paths rightOasObject) {\n\n    List<OasDiffViolation> violations = new ArrayList<>();\n\n    for (Map.Entry<String, PathItem> entry : leftOasObject.entrySet()) {\n      String lPath = entry.getKey();\n      PathItem lPathItem = entry.getValue();\n      OasObjectPropertyLocation lPathItemLoc = leftLocation.property(lPath, PATH_ITEM);\n\n      PathItem rPathItem = rightOasObject.get(lPath);\n      if (rPathItem == null) {\n        violations.addAll(doDiffValidateProperty(context, lPathItemLoc, lPathItem, null, null, pathItemValidators));\n      } else {\n        OasObjectPropertyLocation rPathItemLoc = rightLocation.property(lPath, PATH_ITEM);\n        violations.addAll(\n          doDiffValidateProperty(context, lPathItemLoc, lPathItem, rPathItemLoc, rPathItem, pathItemValidators));\n      }\n\n    }\n\n    for (Map.Entry<String, PathItem> entry : rightOasObject.entrySet()) {\n      String rPath = entry.getKey();\n      if (leftOasObject.containsKey(rPath)) {\n        continue;\n      }\n      PathItem rPathItem = entry.getValue();\n      OasObjectPropertyLocation rPathItemLoc = leftLocation.property(rPath, PATH_ITEM);\n      violations.addAll(doDiffValidateProperty(context, null, null, rPathItemLoc, rPathItem, pathItemValidators));\n    }\n    return violations;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/requestbody/RequestBodyContentDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.requestbody;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.media.MediaType;\nimport io.swagger.v3.oas.models.parameters.RequestBody;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.MEDIA_TYPE;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.*;\n\npublic class RequestBodyContentDiffValidator\n  extends MapPropertyDiffValidator<RequestBody, MediaType>\n  implements RequestBodyDiffValidator {\n\n  public RequestBodyContentDiffValidator(List<MediaTypeDiffValidator> mediaTypeValidators) {\n    super(mediaTypeValidators);\n  }\n\n  @Override\n  public List<OasDiffViolation> validate(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    RequestBody leftOasObject, OasObjectPropertyLocation rightLocation, RequestBody rightOasObject) {\n\n    enterRequestBody(context);\n\n    List<OasDiffViolation> violations = super\n      .validate(context, leftLocation, leftOasObject, rightLocation, rightOasObject);\n\n    leaveRequestBody(context);\n    return violations;\n  }\n\n  @Override\n  protected Map<String, MediaType> getMapProperty(RequestBody oasObject) {\n    return oasObject.getContent();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"content\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return MEDIA_TYPE;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/response/ResponseContentDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.response;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.media.MediaType;\nimport io.swagger.v3.oas.models.responses.ApiResponse;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.MEDIA_TYPE;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.*;\n\npublic class ResponseContentDiffValidator\n  extends MapPropertyDiffValidator<ApiResponse, MediaType>\n  implements ResponseDiffValidator {\n\n  public ResponseContentDiffValidator(List<MediaTypeDiffValidator> mediaTypeValidators) {\n    super(mediaTypeValidators);\n  }\n\n  @Override\n  public List<OasDiffViolation> validate(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    ApiResponse leftOasObject, OasObjectPropertyLocation rightLocation, ApiResponse rightOasObject) {\n\n    enterResponse(context);\n\n    List<OasDiffViolation> violations = super\n      .validate(context, leftLocation, leftOasObject, rightLocation, rightOasObject);\n\n    leaveResponse(context);\n    return violations;\n  }\n\n  @Override\n  protected Map<String, MediaType> getMapProperty(ApiResponse oasObject) {\n    return oasObject.getContent();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"content\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return MEDIA_TYPE;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/response/ResponseHeadersDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.response;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport io.swagger.v3.oas.models.headers.Header;\nimport io.swagger.v3.oas.models.responses.ApiResponse;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.HEADER;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.enterResponse;\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasDiffValidationContextUtils.leaveResponse;\n\npublic class ResponseHeadersDiffValidator\n  extends MapPropertyDiffValidator<ApiResponse, Header>\n  implements ResponseDiffValidator {\n\n  public ResponseHeadersDiffValidator(List<HeaderDiffValidator> valueValidators) {\n    super(valueValidators);\n  }\n\n  @Override\n  public List<OasDiffViolation> validate(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    ApiResponse leftOasObject, OasObjectPropertyLocation rightLocation, ApiResponse rightOasObject) {\n\n    enterResponse(context);\n\n    List<OasDiffViolation> violations = super\n      .validate(context, leftLocation, leftOasObject, rightLocation, rightOasObject);\n\n    leaveResponse(context);\n    return violations;\n  }\n\n  @Override\n  protected Map<String, Header> getMapProperty(ApiResponse components) {\n    return components.getHeaders();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"headers\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return HEADER;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/responses/ResponsesResponsesDiffValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.responses;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.responses.ApiResponse;\nimport io.swagger.v3.oas.models.responses.ApiResponses;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasObjectDiffValidatorUtils.doDiffValidateProperty;\n\npublic class ResponsesResponsesDiffValidator\n  extends OasObjectDiffValidatorTemplate<ApiResponses>\n  implements ResponsesDiffValidator {\n\n  private final List<ResponseDiffValidator> responseValidators;\n\n  public ResponsesResponsesDiffValidator(List<ResponseDiffValidator> responseValidators) {\n    this.responseValidators = responseValidators;\n  }\n\n  @Override\n  public List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, ApiResponses leftOasObject,\n    OasObjectPropertyLocation rightLocation, ApiResponses rightOasObject) {\n\n    List<OasDiffViolation> violations = new ArrayList<>();\n\n    for (Map.Entry<String, ApiResponse> entry : leftOasObject.entrySet()) {\n      String leftStatus = entry.getKey();\n      ApiResponse leftResponse = entry.getValue();\n      OasObjectPropertyLocation leftResponseLoc = leftLocation.property(leftStatus, OasObjectType.RESPONSE);\n\n      ApiResponse rightResponse = rightOasObject.get(leftStatus);\n      if (rightResponse == null) {\n        violations.addAll(\n          doDiffValidateProperty(\n            context,\n            leftResponseLoc,\n            leftResponse,\n            null,\n            null,\n            responseValidators\n          )\n        );\n      } else {\n        OasObjectPropertyLocation rightResponseLoc = rightLocation.property(leftStatus, OasObjectType.RESPONSE);\n        violations.addAll(\n          doDiffValidateProperty(\n            context,\n            leftResponseLoc,\n            leftResponse,\n            rightResponseLoc,\n            rightResponse,\n            responseValidators\n          )\n        );\n      }\n    }\n\n    for (Map.Entry<String, ApiResponse> entry : rightOasObject.entrySet()) {\n      String rightStatus = entry.getKey();\n      if (leftOasObject.containsKey(rightStatus)) {\n        continue;\n      }\n      ApiResponse rightResponse = entry.getValue();\n      OasObjectPropertyLocation rightResponseLoc = rightLocation.property(rightStatus, OasObjectType.RESPONSE);\n      violations.addAll(\n        doDiffValidateProperty(\n          context,\n          null,\n          null,\n          rightResponseLoc,\n          rightResponse,\n          responseValidators\n        )\n      );\n    }\n    return violations;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/skeleton/schema/SchemaDiffValidatorEngine.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.*;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport io.swagger.v3.oas.models.media.ArraySchema;\nimport io.swagger.v3.oas.models.media.ComposedSchema;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.diffvalidation.util.OasObjectDiffValidatorUtils.*;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SCHEMA;\nimport static java.util.Collections.singletonList;\nimport static java.util.stream.Collectors.toList;\n\n/**\n * Schema object difference validator engine.\n * It does validation recursively\n */\npublic class SchemaDiffValidatorEngine\n  extends OasObjectDiffValidatorTemplate<Schema>\n  implements SchemaDiffValidator {\n\n  private final List<SchemaAddValidator> schemaAddValidators;\n  private final List<SchemaDelValidator> schemaDelValidators;\n  private final List<SchemaCompareValidator> schemaCompareValidators;\n\n  public SchemaDiffValidatorEngine(\n    List<SchemaAddValidator> schemaAddValidators,\n    List<SchemaDelValidator> schemaDelValidators,\n    List<SchemaCompareValidator> schemaCompareValidators) {\n    this.schemaAddValidators = new ArrayList<>(schemaAddValidators);\n    this.schemaDelValidators = new ArrayList<>(schemaDelValidators);\n    this.schemaCompareValidators = new ArrayList<>(schemaCompareValidators);\n  }\n\n  @Override\n  protected List<OasDiffViolation> validateAdd(OasDiffValidationContext context, OasObjectPropertyLocation rightLocation,\n    Schema rightOasObject) {\n\n    return schemaAddValidators\n      .stream()\n      .map(v -> v.validate(context, rightLocation, rightOasObject))\n      .flatMap(list -> list.stream())\n      .collect(toList());\n\n  }\n\n  @Override\n  protected List<OasDiffViolation> validateDel(OasDiffValidationContext context, OasObjectPropertyLocation leftLocation,\n    Schema leftOasObject) {\n\n    return schemaDelValidators\n      .stream()\n      .map(v -> v.validate(context, leftLocation, leftOasObject))\n      .flatMap(list -> list.stream())\n      .collect(toList());\n\n  }\n\n  @Override\n  protected List<OasDiffViolation> validateCompare(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Schema leftOasObject,\n    OasObjectPropertyLocation rightLocation, Schema rightOasObject) {\n\n    List<OasDiffViolation> violations = new ArrayList<>();\n    violations.addAll(\n      schemaCompareValidators\n        .stream()\n        .map(v -> v.validate(context, leftLocation, leftOasObject, rightLocation, rightOasObject))\n        .flatMap(list -> list.stream())\n        .collect(toList())\n    );\n\n    violations.addAll(\n      validateCompareOrdinary(context, leftLocation, leftOasObject, rightLocation, rightOasObject)\n    );\n    violations.addAll(\n      validateCompareArray(context, leftLocation, leftOasObject, rightLocation, rightOasObject)\n    );\n    violations.addAll(\n      validateCompareComposed(context, leftLocation, leftOasObject, rightLocation, rightOasObject)\n    );\n    return violations;\n\n  }\n\n  private List<OasDiffViolation> validateCompareOrdinary(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Schema leftOasObject,\n    OasObjectPropertyLocation rightLocation, Schema rightOasObject) {\n\n    return doDiffValidateMapProperty(\n      context,\n      \"properties\",\n      leftLocation,\n      leftOasObject.getProperties(),\n      rightLocation,\n      rightOasObject.getProperties(),\n      SCHEMA,\n      singletonList(this)\n    );\n\n  }\n\n  private List<OasDiffViolation> validateCompareArray(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Schema leftOasObject,\n    OasObjectPropertyLocation rightLocation, Schema rightOasObject) {\n\n    Schema leftItems = null;\n    OasObjectPropertyLocation leftItemsLocation = null;\n    if (leftOasObject instanceof ArraySchema) {\n      leftItems = ((ArraySchema) leftOasObject).getItems();\n      leftItemsLocation = leftLocation.property(\"items\", SCHEMA);\n    }\n\n    Schema<?> rightItems = null;\n    OasObjectPropertyLocation rightItemsLocation = null;\n    if (rightOasObject instanceof ArraySchema) {\n      rightItems = ((ArraySchema) rightOasObject).getItems();\n      rightItemsLocation = rightLocation.property(\"items\", SCHEMA);\n    }\n\n    return doDiffValidateProperty(\n      context,\n      leftItemsLocation,\n      leftItems,\n      rightItemsLocation,\n      rightItems,\n      singletonList(this)\n    );\n\n  }\n\n  private List<OasDiffViolation> validateCompareComposed(OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation, Schema leftOasObject,\n    OasObjectPropertyLocation rightLocation, Schema rightOasObject) {\n\n    List<OasDiffViolation> violations = new ArrayList<>();\n\n    List<Schema> leftAllOf = null;\n    List<Schema> leftOneOf = null;\n    List<Schema> leftAnyOf = null;\n\n    if (leftOasObject instanceof ComposedSchema) {\n      leftAllOf = ((ComposedSchema) leftOasObject).getAllOf();\n      leftOneOf = ((ComposedSchema) leftOasObject).getOneOf();\n      leftAnyOf = ((ComposedSchema) leftOasObject).getAnyOf();\n    }\n\n    List<Schema> rightAllOf = null;\n    List<Schema> rightOneOf = null;\n    List<Schema> rightAnyOf = null;\n\n    if (rightOasObject instanceof ComposedSchema) {\n      rightAllOf = ((ComposedSchema) rightOasObject).getAllOf();\n      rightOneOf = ((ComposedSchema) rightOasObject).getOneOf();\n      rightAnyOf = ((ComposedSchema) rightOasObject).getAnyOf();\n    }\n\n    violations.addAll(\n      doDiffValidateListProperty(\n        context,\n        \"allOf\",\n        leftLocation,\n        leftAllOf,\n        rightLocation,\n        rightAllOf,\n        SCHEMA,\n        schema -> System.identityHashCode(schema),\n        singletonList(this)\n      )\n    );\n\n    violations.addAll(\n      doDiffValidateListProperty(\n        context,\n        \"oneOf\",\n        leftLocation,\n        leftOneOf,\n        rightLocation,\n        rightOneOf,\n        SCHEMA,\n        schema -> System.identityHashCode(schema),\n        singletonList(this)\n      )\n    );\n\n    violations.addAll(\n      doDiffValidateListProperty(\n        context,\n        \"anyOf\",\n        leftLocation,\n        leftAnyOf,\n        rightLocation,\n        rightAnyOf,\n        SCHEMA,\n        schema -> System.identityHashCode(schema),\n        singletonList(this)\n      )\n    );\n\n    return violations;\n\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/util/ChangeRangeCheckUtils.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.util;\n\nimport java.util.List;\nimport java.util.Objects;\n\npublic class ChangeRangeCheckUtils {\n\n  public static boolean isNotViolated(Object left, Object right, List<Object[]> allowedList) {\n\n    if (Objects.equals(left, right)) {\n      return true;\n    }\n    for (Object[] objects : allowedList) {\n      if (Objects.equals(objects[0], left) && Objects.equals(objects[1], right)) {\n        return true;\n      }\n    }\n    return false;\n\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/util/OasDiffValidationContextUtils.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.util;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\n\npublic class OasDiffValidationContextUtils {\n\n  private static final String IN_REQUEST_BODY = OasDiffValidationContextUtils.class.getName() + \".IN_REQUEST_BODY\";\n  private static final String IN_PARAMETER = OasDiffValidationContextUtils.class.getName() + \".IN_PARAMETER\";\n  private static final String IN_RESPONSE = OasDiffValidationContextUtils.class.getName() + \".IN_RESPONSE\";\n\n  public static void enterRequestBody(OasDiffValidationContext context) {\n    context.setAttribute(IN_REQUEST_BODY, true);\n  }\n\n  public static void leaveRequestBody(OasDiffValidationContext context) {\n    context.removeAttribute(IN_REQUEST_BODY);\n  }\n\n  public static void enterResponse(OasDiffValidationContext context) {\n    context.setAttribute(IN_RESPONSE, true);\n  }\n\n  public static void leaveResponse(OasDiffValidationContext context) {\n    context.removeAttribute(IN_RESPONSE);\n  }\n\n  public static void enterParameter(OasDiffValidationContext context) {\n    context.setAttribute(IN_PARAMETER, true);\n  }\n\n  public static void leaveParameter(OasDiffValidationContext context) {\n    context.removeAttribute(IN_PARAMETER);\n  }\n\n  public static boolean isInRequestBody(OasDiffValidationContext context) {\n    return Boolean.TRUE.equals(context.getAttribute(IN_REQUEST_BODY));\n  }\n\n  public static boolean isInResponse(OasDiffValidationContext context) {\n    return Boolean.TRUE.equals(context.getAttribute(IN_RESPONSE));\n  }\n\n  public static boolean isInParameter(OasDiffValidationContext context) {\n    return Boolean.TRUE.equals(context.getAttribute(IN_PARAMETER));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/util/OasObjectDiffValidatorUtils.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.util;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationException;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasObjectDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Function;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.emptyMap;\n\npublic abstract class OasObjectDiffValidatorUtils {\n\n  private OasObjectDiffValidatorUtils() {\n    // singleton\n  }\n\n  /**\n   * assert parameters is not null-malformed\n   *\n   * @param leftLocation\n   * @param leftOasObject\n   * @param rightLocation\n   * @param rightOasObject\n   * @param <T>\n   */\n  public static <T> void assertNullGood(\n    OasObjectPropertyLocation leftLocation, T leftOasObject,\n    OasObjectPropertyLocation rightLocation, T rightOasObject) {\n\n    assertNullConsistent(leftLocation, leftOasObject, rightLocation, rightOasObject);\n\n    if (leftOasObject == null && rightOasObject == null) {\n      throw new OasDiffValidationException(\"leftLocation, leftOasObject, rightLocation, rightOasObject are all null\");\n    }\n  }\n\n  /**\n   * @param context\n   * @param leftLocation\n   * @param leftOasObject  null-safe\n   * @param rightLocation\n   * @param rightOasObject null-safe\n   * @param validators\n   * @param <T>\n   * @return\n   */\n  public static <T> List<OasDiffViolation> doDiffValidateProperty(\n    OasDiffValidationContext context,\n    OasObjectPropertyLocation leftLocation,\n    T leftOasObject,\n    OasObjectPropertyLocation rightLocation,\n    T rightOasObject,\n    List<? extends OasObjectDiffValidator<T>> validators) {\n\n    assertNullConsistent(leftLocation, leftOasObject, rightLocation, rightOasObject);\n\n    if (leftLocation == null && rightLocation == null) {\n      return emptyList();\n    }\n\n    List<OasDiffViolation> violations = new ArrayList<>();\n    for (OasObjectDiffValidator validator : validators) {\n      violations.addAll(validator.validate(context, leftLocation, leftOasObject, rightLocation, rightOasObject));\n    }\n    return violations;\n  }\n\n  /**\n   * @param context\n   * @param listPropertyName\n   * @param leftOwnerLocation\n   * @param leftListProperty   null-safe\n   * @param rightOwnerLocation\n   * @param rightListProperty  null-safe\n   * @param elementType\n   * @param elementKeyMapper\n   * @param validators\n   * @param <T>\n   * @return\n   */\n  public static <T> List<OasDiffViolation> doDiffValidateListProperty(\n    OasDiffValidationContext context,\n    String listPropertyName,\n    OasObjectPropertyLocation leftOwnerLocation,\n    List<T> leftListProperty,\n    OasObjectPropertyLocation rightOwnerLocation,\n    List<T> rightListProperty,\n    OasObjectType elementType,\n    Function<T, ?> elementKeyMapper,\n    List<? extends OasObjectDiffValidator<T>> validators) {\n\n    assertOwnerLocationNotNull(leftOwnerLocation, rightOwnerLocation);\n\n    if (leftListProperty == null) {\n      leftListProperty = emptyList();\n    }\n\n    if (rightListProperty == null) {\n      rightListProperty = emptyList();\n    }\n\n    List<OasDiffViolation> violations = new ArrayList<>();\n\n    for (int i = 0; i < leftListProperty.size(); i++) {\n      T leftElement = leftListProperty.get(i);\n      Object leftElementKey = elementKeyMapper.apply(leftElement);\n      OasObjectPropertyLocation leftElementLoc =\n        leftOwnerLocation.property(listPropertyName + \"[\" + i + \"]\", elementType);\n\n      int rightElementIndex = indexOf(rightListProperty, leftElementKey, elementKeyMapper);\n      if (rightElementIndex == -1) {\n        violations.addAll(doDiffValidateProperty(context, leftElementLoc, leftElement, null, null, validators));\n      } else {\n        T rightElement = rightListProperty.get(rightElementIndex);\n        OasObjectPropertyLocation rightElementLoc =\n          rightOwnerLocation.property(listPropertyName + \"[\" + rightElementIndex + \"]\", elementType);\n        violations.addAll(\n          doDiffValidateProperty(context, leftElementLoc, leftElement, rightElementLoc, rightElement, validators));\n      }\n    }\n\n    for (int i = 0; i < rightListProperty.size(); i++) {\n      T rightElement = rightListProperty.get(i);\n      Object rightElementKey = elementKeyMapper.apply(rightElement);\n      OasObjectPropertyLocation rightElementLoc =\n        rightOwnerLocation.property(listPropertyName + \"[\" + i + \"]\", elementType);\n\n      int leftElementIndex = indexOf(leftListProperty, rightElementKey, elementKeyMapper);\n      if (leftElementIndex != -1) {\n        continue;\n      }\n      violations.addAll(doDiffValidateProperty(context, null, null, rightElementLoc, rightElement, validators));\n\n    }\n    return violations;\n\n  }\n\n  private static <T> int indexOf(List<T> elementList, Object searchKey, Function<T, ?> elementKeyMapper) {\n    for (int i = 0; i < elementList.size(); i++) {\n      T element = elementList.get(i);\n      if (elementKeyMapper.apply(element).equals(searchKey)) {\n        return i;\n      }\n\n    }\n    return -1;\n  }\n\n  /**\n   * @param context\n   * @param mapPropertyName\n   * @param leftOwnerLocation\n   * @param leftMapProperty    null-safe\n   * @param rightOwnerLocation\n   * @param rightMapProperty   null-safe\n   * @param valueType\n   * @param validators\n   * @param <T>\n   * @return\n   */\n  public static <T> List<OasDiffViolation> doDiffValidateMapProperty(\n    OasDiffValidationContext context,\n    String mapPropertyName,\n    OasObjectPropertyLocation leftOwnerLocation,\n    Map<String, T> leftMapProperty,\n    OasObjectPropertyLocation rightOwnerLocation,\n    Map<String, T> rightMapProperty,\n    OasObjectType valueType,\n    List<? extends OasObjectDiffValidator<T>> validators\n  ) {\n\n    assertOwnerLocationNotNull(leftOwnerLocation, rightOwnerLocation);\n\n    if (leftMapProperty == null) {\n      leftMapProperty = emptyMap();\n    }\n    if (rightMapProperty == null) {\n      rightMapProperty = emptyMap();\n    }\n\n    List<OasDiffViolation> violations = new ArrayList<>();\n\n    for (Map.Entry<String, T> entry : leftMapProperty.entrySet()) {\n      String leftKey = entry.getKey();\n      T leftValue = entry.getValue();\n\n      String keyName = mapPropertyName + \".'\" + leftKey + \"'\";\n      OasObjectPropertyLocation leftValueLoc = leftOwnerLocation.property(keyName, valueType);\n\n      T rightValue = rightMapProperty.get(leftKey);\n      if (rightValue == null) {\n        violations.addAll(doDiffValidateProperty(context, leftValueLoc, leftValue, null, null, validators));\n      } else {\n        OasObjectPropertyLocation rightValueLoc = rightOwnerLocation.property(keyName, valueType);\n        violations\n          .addAll(doDiffValidateProperty(context, leftValueLoc, leftValue, rightValueLoc, rightValue, validators));\n      }\n\n    }\n\n    for (Map.Entry<String, T> entry : rightMapProperty.entrySet()) {\n      String rightKey = entry.getKey();\n      if (leftMapProperty.containsKey(rightKey)) {\n        continue;\n      }\n\n      T rightValue = entry.getValue();\n      String keyName = mapPropertyName + \".'\" + rightKey + \"'\";\n      OasObjectPropertyLocation rightLoc = rightOwnerLocation.property(keyName, valueType);\n      violations.addAll(doDiffValidateProperty(context, null, null, rightLoc, rightValue, validators));\n\n    }\n    return violations;\n  }\n\n\n  private static void assertOwnerLocationNotNull(\n    OasObjectPropertyLocation leftOwnerLocation,\n    OasObjectPropertyLocation rightOwnerLocation) {\n    if (leftOwnerLocation == null) {\n      throw new OasDiffValidationException(\"leftOwnerLocation is null\");\n    }\n    if (rightOwnerLocation == null) {\n      throw new OasDiffValidationException(\"rightOwnerLocation is null\");\n    }\n  }\n\n  private static <T> void assertNullConsistent(\n    OasObjectPropertyLocation leftLocation, T leftOasObject,\n    OasObjectPropertyLocation rightLocation, T rightOasObject) {\n\n    if (leftLocation == null ^ leftOasObject == null) {\n      throw new OasDiffValidationException(\"leftLocation, leftOasObject should be both null or not\");\n    }\n    if (rightLocation == null ^ rightOasObject == null) {\n      throw new OasDiffValidationException(\"rightLocation, rightOasObject should be both null or not\");\n    }\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/util/ParameterUtils.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.util;\n\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\npublic abstract class ParameterUtils {\n\n  public static String getKeyString(Parameter parameter) {\n    return new StringBuilder()\n      .append(\"[name=\")\n      .append(parameter.getName())\n      .append(\",in=\")\n      .append(parameter.getIn())\n      .append(\"]\")\n      .toString();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/util/StringCaseUtils.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.util;\n\nimport org.apache.commons.lang3.StringUtils;\n\nimport java.util.regex.Pattern;\n\npublic abstract class StringCaseUtils {\n\n  private static final Pattern LOWER_CAMEL_CASE = Pattern.compile(\"^[a-z]+((\\\\d)|([A-Z0-9][a-z0-9]+))*([A-Z])?$\");\n\n  private static final Pattern UPPER_CAMEL_CASE = Pattern.compile(\"^[A-Z]([a-z0-9]+[A-Z]?)*$\");\n\n  private static final Pattern UPPER_HYPHEN_CASE = Pattern.compile(\"^([A-Z][a-z0-9]*-)*([A-Z][a-z0-9]*)$\");\n\n  private StringCaseUtils() {\n    // singleton\n  }\n\n  public static boolean isLowerCamelCase(String string) {\n    if (StringUtils.isBlank(string)) {\n      return false;\n    }\n    return LOWER_CAMEL_CASE.matcher(string).matches();\n  }\n\n  public static boolean isUpperCamelCase(String string) {\n    if (StringUtils.isBlank(string)) {\n      return false;\n    }\n    return UPPER_CAMEL_CASE.matcher(string).matches();\n  }\n\n  public static boolean isUpperHyphenCase(String string) {\n    if (StringUtils.isBlank(string)) {\n      return false;\n    }\n    return UPPER_HYPHEN_CASE.matcher(string).matches();\n  }\n\n  public static boolean isMatchCase(String expectedCase, String string) {\n    switch (expectedCase) {\n    case \"upper-camel-case\":\n      return isUpperCamelCase(string);\n    case \"lower-camel-case\":\n      return isLowerCamelCase(string);\n    case \"upper-hyphen-case\":\n      return isUpperHyphenCase(string);\n    default:\n      throw new IllegalArgumentException(\"Unrecognized case: \" + expectedCase);\n    }\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/util/SyntaxChecker.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.util;\n\nimport static java.util.Collections.emptyList;\n\nimport java.util.List;\n\nimport io.swagger.v3.parser.OpenAPIV3Parser;\nimport io.swagger.v3.parser.core.models.ParseOptions;\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\n\npublic class SyntaxChecker {\n\n  private SyntaxChecker() {\n    // singleton\n  }\n\n  public static List<String> check(String oasSpecContent) {\n\n    ParseOptions parseOptions = new ParseOptions();\n    parseOptions.setResolve(false);\n    parseOptions.setResolveFully(false);\n    parseOptions.setResolveCombinators(false);\n    parseOptions.setFlatten(false);\n\n    OpenAPIV3Parser parser = new OpenAPIV3Parser();\n    SwaggerParseResult result = parser.readContents(oasSpecContent, null, parseOptions);\n    return result.getMessages() == null ? emptyList() : result.getMessages();\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/CallbackValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.callbacks.Callback;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#callbackObject\">Callback Object</a> validator\n */\npublic interface CallbackValidator extends OasObjectValidator<Callback> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/ComponentsValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.Components;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a> validator\n */\npublic interface ComponentsValidator extends OasObjectValidator<Components> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/DefaultOasSpecValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport io.swagger.v3.oas.models.OpenAPI;\n\nimport java.util.List;\n\nimport static java.util.stream.Collectors.toList;\n\npublic class DefaultOasSpecValidator implements OasSpecValidator {\n\n  private List<OpenApiValidator> openApiValidators;\n\n  public DefaultOasSpecValidator(List<OpenApiValidator> openApiValidators) {\n    this.openApiValidators = openApiValidators;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OpenAPI openAPI) {\n\n    OasObjectPropertyLocation location = OasObjectPropertyLocation.root();\n\n    return openApiValidators\n      .stream()\n      .map(validator -> validator.validate(context, location, openAPI))\n      .flatMap(list -> list.stream())\n      .collect(toList());\n\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/EncodingValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.media.Encoding;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#encodingObject\">Encoding Object</a> validator\n */\npublic interface EncodingValidator extends OasObjectValidator<Encoding> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/ExampleValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.examples.Example;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#exampleObject\">Example Object</a> validator\n */\npublic interface ExampleValidator extends OasObjectValidator<Example> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/HeaderValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.headers.Header;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#headerObject\">Header Object</a> validator\n */\npublic interface HeaderValidator extends OasObjectValidator<Header> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/InfoValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.info.Info;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#infoObject\">Info Object</a> validator\n */\npublic interface InfoValidator extends OasObjectValidator<Info> {\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/LinkValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.links.Link;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#link-object\">Link Object</a> validator\n */\npublic interface LinkValidator extends OasObjectValidator<Link> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/ListPropertyRequiredValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.commons.collections4.CollectionUtils;\nimport org.apache.commons.lang3.StringUtils;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\npublic abstract class ListPropertyRequiredValidator<T, P> implements OasObjectValidator<T> {\n\n  @Override\n  final public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    T oasObject) {\n\n    if (StringUtils.isNotBlank(get$ref(oasObject))) {\n      return emptyList();\n    }\n\n    List<P> listProperty = getListProperty(oasObject);\n    if (CollectionUtils.isEmpty(listProperty)) {\n      OasObjectPropertyLocation propertyLoc = location.property(getListPropertyName(), getElementType());\n      return singletonList(new OasViolation(propertyLoc, ViolationMessages.REQUIRED));\n    }\n    return emptyList();\n\n  }\n\n  protected abstract String get$ref(T oasObject);\n\n  protected abstract List<P> getListProperty(T oasObject);\n\n  protected abstract String getListPropertyName();\n\n  protected abstract OasObjectType getElementType();\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/ListPropertyValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.commons.lang3.StringUtils;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.validation.util.OasObjectValidatorUtils.doValidateListProperty;\nimport static java.util.Collections.emptyList;\n\npublic abstract class ListPropertyValidator<T, P> implements OasObjectValidator<T> {\n\n  private final List<? extends OasObjectValidator<P>> valueValidators;\n\n  protected ListPropertyValidator(List<? extends OasObjectValidator<P>> valueValidators) {\n    this.valueValidators = valueValidators;\n  }\n\n  @Override\n  final public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    T oasObject) {\n\n    if (StringUtils.isNotBlank(get$ref(oasObject))) {\n      return emptyList();\n    }\n\n    return doValidateListProperty(\n      context, location,\n      getListPropertyName(),\n      getListProperty(oasObject),\n      getElementType(),\n      valueValidators\n    );\n\n  }\n\n  protected abstract String get$ref(T oasObject);\n\n  protected abstract List<P> getListProperty(T oasObject);\n\n  protected abstract String getListPropertyName();\n\n  protected abstract OasObjectType getElementType();\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/MapPropertyKeysValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.commons.lang3.StringUtils;\n\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\nimport static org.apache.servicecomb.toolkit.oasv.validation.util.OasObjectValidatorUtils.doValidateMapPropertyKeys;\nimport static java.util.Collections.emptyList;\n\npublic abstract class MapPropertyKeysValidator<T> implements OasObjectValidator<T> {\n\n  private final Predicate<String> keyPredicate;\n\n  private final Function<String, String> errorFunction;\n\n  public MapPropertyKeysValidator(Predicate<String> keyPredicate,\n    Function<String, String> errorFunction) {\n    this.keyPredicate = keyPredicate;\n    this.errorFunction = errorFunction;\n  }\n\n  @Override\n  final public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    T oasObject) {\n\n    if (StringUtils.isNotBlank(get$ref(oasObject))) {\n      return emptyList();\n    }\n\n    return doValidateMapPropertyKeys(\n      location,\n      getMapPropertyName(),\n      getMapProperty(oasObject),\n      keyPredicate,\n      errorFunction\n    );\n\n  }\n\n  protected abstract String get$ref(T oasObject);\n\n  protected abstract Map<String, ?> getMapProperty(T oasObject);\n\n  protected abstract String getMapPropertyName();\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/MapPropertyValuesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.commons.lang3.StringUtils;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.validation.util.OasObjectValidatorUtils.doValidateMapPropertyValues;\nimport static java.util.Collections.emptyList;\n\npublic abstract class MapPropertyValuesValidator<T, P> implements OasObjectValidator<T> {\n\n  private final List<? extends OasObjectValidator<P>> valueValidators;\n\n  protected MapPropertyValuesValidator(List<? extends OasObjectValidator<P>> valueValidators) {\n    this.valueValidators = valueValidators;\n  }\n\n  @Override\n  public final List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    T oasObject) {\n\n    if (StringUtils.isNotBlank(get$ref(oasObject))) {\n      return emptyList();\n    }\n\n    return doValidateMapPropertyValues(\n      context, location,\n      getMapPropertyName(),\n      getMapProperty(oasObject),\n      getValueType(),\n      valueValidators\n    );\n\n  }\n\n  protected abstract String get$ref(T oasObject);\n\n  protected abstract Map<String, P> getMapProperty(T oasObject);\n\n  protected abstract String getMapPropertyName();\n\n  protected abstract OasObjectType getValueType();\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/MediaTypeValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.media.MediaType;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#media-type-object\">Media Type Object</a> validator\n */\npublic interface MediaTypeValidator extends OasObjectValidator<MediaType> {\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/OasObjectValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\n\nimport java.util.List;\n\n/**\n * @param <T> Objects defined in <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#table-of-contents\">OpenAPI Specification</a>\n */\npublic interface OasObjectValidator<T> {\n\n  /**\n   * @param context   validation context\n   * @param location  OpenAPI Object location\n   * @param oasObject OpenAPI Object\n   * @return validation violations, maybe empty list\n   */\n  List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location, T oasObject);\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/OasSpecValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.OpenAPI;\n\nimport java.util.List;\n\n/**\n * OAS Spec validator\n */\npublic interface OasSpecValidator {\n\n  List<OasViolation> validate(OasValidationContext context, OpenAPI openAPI);\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/OasValidationContext.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.OpenAPI;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * OAS object validation context\n */\npublic class OasValidationContext {\n\n  private final OpenAPI openAPI;\n\n  private final Map<String, Object> attributes = new HashMap<>();\n\n  public OasValidationContext(OpenAPI openAPI) {\n    this.openAPI = openAPI;\n  }\n\n  public OpenAPI getOpenAPI() {\n    return openAPI;\n  }\n\n  public <T> T getAttribute(String name) {\n    return (T) attributes.get(name);\n  }\n\n  public <T> void setAttribute(String name, T attr) {\n    this.attributes.put(name, attr);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/OasViolation.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\n\nimport java.util.Objects;\nimport java.util.StringJoiner;\n\n/**\n * OpenAPI v3 validation violation\n */\npublic class OasViolation {\n\n  /**\n   * Object location\n   */\n  private final OasObjectPropertyLocation location;\n\n  /**\n   * Error message\n   */\n  private final String error;\n\n  public OasViolation(OasObjectPropertyLocation location, String error) {\n    this.location = location;\n    this.error = error;\n  }\n\n  public OasObjectPropertyLocation getLocation() {\n    return location;\n  }\n\n  public String getError() {\n    return error;\n  }\n\n  @Override\n  public String toString() {\n    return new StringJoiner(\", \", OasViolation.class.getSimpleName() + \"[\", \"]\")\n      .add(\"location=\" + location)\n      .add(\"error='\" + error + \"'\")\n      .toString();\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    OasViolation that = (OasViolation) o;\n    return Objects.equals(location, that.location) &&\n      Objects.equals(error, that.error);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(location, error);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/ObjectPropertyRequiredValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\n/**\n * Object property should not be null validator\n *\n * @param <T> Objects defined in <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#table-of-contents\">OpenAPI Specification</a>\n * @param <P> Property type\n */\npublic abstract class ObjectPropertyRequiredValidator<T, P> implements OasObjectValidator<T> {\n\n  @Override\n  final public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n      T oasObject) {\n    if (StringUtils.isNotBlank(get$ref(oasObject))) {\n      return emptyList();\n    }\n    P propertyObject = getPropertyObject(oasObject);\n    if (propertyObject == null) {\n      OasObjectPropertyLocation propertyLoc = location.property(getPropertyName(), getPropertyType());\n      return singletonList(new OasViolation(propertyLoc, ViolationMessages.REQUIRED));\n    }\n    if (propertyObject != null && String.class.equals(propertyObject.getClass())\n        && StringUtils.isBlank((CharSequence) propertyObject)) {\n      OasObjectPropertyLocation propertyLoc = location.property(getPropertyName(), getPropertyType());\n      return singletonList(new OasViolation(propertyLoc, ViolationMessages.REQUIRED));\n    }\n    return emptyList();\n  }\n\n  protected abstract String get$ref(T oasObject);\n\n  protected abstract P getPropertyObject(T oasObject);\n\n  protected abstract String getPropertyName();\n\n  protected abstract OasObjectType getPropertyType();\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/ObjectPropertyValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.commons.lang3.StringUtils;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.validation.util.OasObjectValidatorUtils.doValidateProperty;\nimport static java.util.Collections.emptyList;\n\n/**\n * OAS Object object property validator\n *\n * @param <T> Objects defined in <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#table-of-contents\">OpenAPI Specification</a>\n * @param <P> Property type\n */\npublic abstract class ObjectPropertyValidator<T, P> implements OasObjectValidator<T> {\n\n  private final List<? extends OasObjectValidator<P>> oasObjectValidators;\n\n  protected ObjectPropertyValidator(List<? extends OasObjectValidator<P>> oasObjectValidators) {\n    this.oasObjectValidators = oasObjectValidators;\n  }\n\n  @Override\n  final public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    T oasObject) {\n    if (StringUtils.isNotBlank(get$ref(oasObject))) {\n      return emptyList();\n    }\n\n    P propertyObject = getPropertyObject(oasObject);\n    if (propertyObject == null) {\n      return emptyList();\n    }\n    OasObjectPropertyLocation propertyLoc = location.property(getPropertyName(), getPropertyType());\n    return doValidateProperty(context, propertyLoc, propertyObject, oasObjectValidators);\n\n  }\n\n  protected abstract String get$ref(T oasObject);\n\n  protected abstract P getPropertyObject(T oasObject);\n\n  protected abstract String getPropertyName();\n\n  protected abstract OasObjectType getPropertyType();\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/OpenApiValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.OpenAPI;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#openapi-object\">OpenAPI Object</a> validator\n */\npublic interface OpenApiValidator extends OasObjectValidator<OpenAPI> {\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/OperationValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.Operation;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\">Operation Object</a> validator\n */\npublic interface OperationValidator extends OasObjectValidator<Operation> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/ParameterValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject\">Parameter Object</a> validator\n */\npublic interface ParameterValidator extends OasObjectValidator<Parameter> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/PathItemValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.PathItem;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathItemObject\">Path Item Object</a> validator\n */\npublic interface PathItemValidator extends OasObjectValidator<PathItem> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/PathsValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.Paths;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathsObject\">Paths Object</a> validator\n */\npublic interface PathsValidator extends OasObjectValidator<Paths> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/RequestBodyValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.parameters.RequestBody;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#request-body-object\">Request Object</a> validator\n */\npublic interface RequestBodyValidator extends OasObjectValidator<RequestBody> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/ResponseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.responses.ApiResponse;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responseObject\">Response Object</a> validator\n */\npublic interface ResponseValidator extends OasObjectValidator<ApiResponse> {\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/ResponsesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.responses.ApiResponses;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responsesObject\">Responses Object</a> validator\n */\npublic interface ResponsesValidator extends OasObjectValidator<ApiResponses> {\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/SchemaValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.media.Schema;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject\">Schema Object</a> validator\n */\npublic interface SchemaValidator extends OasObjectValidator<Schema> {\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/SecuritySchemeValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.security.SecurityScheme;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#security-scheme-object\">Security Scheme Object</a> validator\n */\npublic interface SecuritySchemeValidator extends OasObjectValidator<SecurityScheme> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/ServerValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.servers.Server;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#serverObject\">Server Object</a> validator\n */\npublic interface ServerValidator extends OasObjectValidator<Server> {\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/TagValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\nimport io.swagger.v3.oas.models.tags.Tag;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#tagObject\">Tag Object</a> validator\n */\npublic interface TagValidator extends OasObjectValidator<Tag> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/ViolationMessages.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.api;\n\npublic abstract class ViolationMessages {\n\n  public static final String REQUIRED = \"Required\";\n\n  public static final String MUST_BE_EMPTY = \"This field is no allowed\";\n\n  public static final String LOWER_CAMEL_CASE = \"Must be lower camel case\";\n\n  public static final String UPPER_CAMEL_CASE = \"Must be upper camel case\";\n\n  public static final String UPPER_HYPHEN_CASE = \"Must be upper hyphen case\";\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/CallbackValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.CallbackValidator;\n\npublic interface CallbackValidatorFactory extends OasObjectValidatorFactory<CallbackValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/ComponentsValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\n\npublic interface ComponentsValidatorFactory extends OasObjectValidatorFactory<ComponentsValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/EncodingValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.EncodingValidator;\n\npublic interface EncodingValidatorFactory extends OasObjectValidatorFactory<EncodingValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/ExampleValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ExampleValidator;\n\npublic interface ExampleValidatorFactory extends OasObjectValidatorFactory<ExampleValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/HeaderValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.HeaderValidator;\n\npublic interface HeaderValidatorFactory extends OasObjectValidatorFactory<HeaderValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/InfoValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.InfoValidator;\n\npublic interface InfoValidatorFactory extends OasObjectValidatorFactory<InfoValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/LinkValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.LinkValidator;\n\npublic interface LinkValidatorFactory extends OasObjectValidatorFactory<LinkValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/MediaTypeValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MediaTypeValidator;\n\npublic interface MediaTypeValidatorFactory extends OasObjectValidatorFactory<MediaTypeValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/OasObjectValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasObjectValidator;\n\npublic interface OasObjectValidatorFactory<T extends OasObjectValidator> {\n\n  List<T> create(FactoryOptions options);\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/OasSpecValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\n\npublic interface OasSpecValidatorFactory {\n  OasSpecValidator create(FactoryOptions options);\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/OpenApiValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OpenApiValidator;\n\npublic interface OpenApiValidatorFactory extends OasObjectValidatorFactory<OpenApiValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/OperationValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OperationValidator;\n\npublic interface OperationValidatorFactory extends OasObjectValidatorFactory<OperationValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/ParameterValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;\n\npublic interface ParameterValidatorFactory extends OasObjectValidatorFactory<ParameterValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/PathItemValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.PathItemValidator;\n\npublic interface PathItemValidatorFactory extends OasObjectValidatorFactory<PathItemValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/PathsValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.PathsValidator;\n\npublic interface PathsValidatorFactory extends OasObjectValidatorFactory<PathsValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/RequestBodyValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.RequestBodyValidator;\n\npublic interface RequestBodyValidatorFactory extends OasObjectValidatorFactory<RequestBodyValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/ResponseValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ResponseValidator;\n\npublic interface ResponseValidatorFactory extends OasObjectValidatorFactory<ResponseValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/ResponsesValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ResponsesValidator;\n\npublic interface ResponsesValidatorFactory extends OasObjectValidatorFactory<ResponsesValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/SchemaValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.SchemaValidator;\n\npublic interface SchemaValidatorFactory extends OasObjectValidatorFactory<SchemaValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/SecuritySchemeValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.SecuritySchemeValidator;\n\npublic interface SecuritySchemeValidatorFactory extends OasObjectValidatorFactory<SecuritySchemeValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/ServerValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ServerValidator;\n\npublic interface ServerValidatorFactory extends OasObjectValidatorFactory<ServerValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/factory/TagValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.TagValidator;\n\npublic interface TagValidatorFactory extends OasObjectValidatorFactory<TagValidator> {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsCallbacksKeysValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyKeysValidator;\nimport io.swagger.v3.oas.models.Components;\n\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a>\n * .callbacks property key validator\n */\npublic class ComponentsCallbacksKeysValidator extends MapPropertyKeysValidator<Components>\n  implements ComponentsValidator {\n\n  public ComponentsCallbacksKeysValidator(Predicate<String> keyPredicate,\n    Function<String, String> errorFunction) {\n    super(keyPredicate, errorFunction);\n  }\n\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n\n  @Override\n  protected Map<String, ?> getMapProperty(Components components) {\n    return components.getCallbacks();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"callbacks\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsCallbacksValuesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.CallbackValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.callbacks.Callback;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.CALLBACK;\n\npublic class ComponentsCallbacksValuesValidator extends MapPropertyValuesValidator<Components, Callback>\n  implements ComponentsValidator {\n\n  public ComponentsCallbacksValuesValidator(List<CallbackValidator> valueValidators) {\n    super(valueValidators);\n  }\n\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n\n  @Override\n  protected Map<String, Callback> getMapProperty(Components components) {\n    return components.getCallbacks();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"callbacks\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return CALLBACK;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsExamplesKeysValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyKeysValidator;\nimport io.swagger.v3.oas.models.Components;\n\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a>\n * .examples property key validator\n */\npublic class ComponentsExamplesKeysValidator extends MapPropertyKeysValidator<Components>\n  implements ComponentsValidator {\n\n  public ComponentsExamplesKeysValidator(Predicate<String> keyPredicate,\n    Function<String, String> errorFunction) {\n    super(keyPredicate, errorFunction);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, ?> getMapProperty(Components components) {\n    return components.getExamples();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"examples\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsExamplesValuesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ExampleValidator;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.examples.Example;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.EXAMPLE;\n\npublic class ComponentsExamplesValuesValidator extends MapPropertyValuesValidator<Components, Example>\n  implements ComponentsValidator {\n\n  public ComponentsExamplesValuesValidator(List<ExampleValidator> valueValidators) {\n    super(valueValidators);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, Example> getMapProperty(Components components) {\n    return components.getExamples();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"examples\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return EXAMPLE;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsHeadersKeysValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyKeysValidator;\nimport io.swagger.v3.oas.models.Components;\n\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\npublic class ComponentsHeadersKeysValidator extends MapPropertyKeysValidator<Components>\n  implements ComponentsValidator {\n\n  public ComponentsHeadersKeysValidator(Predicate<String> keyPredicate,\n    Function<String, String> errorFunction) {\n    super(keyPredicate, errorFunction);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, ?> getMapProperty(Components components) {\n    return components.getHeaders();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"headers\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsHeadersValuesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.HeaderValidator;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.headers.Header;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.HEADER;\n\npublic class ComponentsHeadersValuesValidator extends MapPropertyValuesValidator<Components, Header>\n  implements ComponentsValidator {\n\n  public ComponentsHeadersValuesValidator(List<HeaderValidator> valueValidators) {\n    super(valueValidators);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, Header> getMapProperty(Components components) {\n    return components.getHeaders();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"headers\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return HEADER;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsLinksKeysValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyKeysValidator;\nimport io.swagger.v3.oas.models.Components;\n\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\npublic class ComponentsLinksKeysValidator extends MapPropertyKeysValidator<Components>\n  implements ComponentsValidator {\n\n  public ComponentsLinksKeysValidator(Predicate<String> keyPredicate,\n    Function<String, String> errorFunction) {\n    super(keyPredicate, errorFunction);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, ?> getMapProperty(Components components) {\n    return components.getLinks();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"links\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsLinksValuesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.LinkValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.links.Link;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.LINK;\n\npublic class ComponentsLinksValuesValidator extends MapPropertyValuesValidator<Components, Link>\n  implements ComponentsValidator {\n\n  public ComponentsLinksValuesValidator(List<LinkValidator> valueValidators) {\n    super(valueValidators);\n  }\n\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n\n  @Override\n  protected Map<String, Link> getMapProperty(Components components) {\n    return components.getLinks();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"links\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return LINK;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsParametersKeysValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyKeysValidator;\nimport io.swagger.v3.oas.models.Components;\n\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\npublic class ComponentsParametersKeysValidator extends MapPropertyKeysValidator<Components>\n  implements ComponentsValidator {\n\n  public ComponentsParametersKeysValidator(Predicate<String> keyPredicate,\n    Function<String, String> errorFunction) {\n    super(keyPredicate, errorFunction);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, ?> getMapProperty(Components components) {\n    return components.getParameters();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"parameters\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsParametersValuesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PARAMETER;\n\npublic class ComponentsParametersValuesValidator extends MapPropertyValuesValidator<Components, Parameter>\n  implements ComponentsValidator {\n\n  public ComponentsParametersValuesValidator(List<ParameterValidator> valueValidators) {\n    super(valueValidators);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, Parameter> getMapProperty(Components components) {\n    return components.getParameters();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"parameters\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return PARAMETER;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsRequestBodiesKeysValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyKeysValidator;\nimport io.swagger.v3.oas.models.Components;\n\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\npublic class ComponentsRequestBodiesKeysValidator extends MapPropertyKeysValidator<Components>\n  implements ComponentsValidator {\n\n  public ComponentsRequestBodiesKeysValidator(Predicate<String> keyPredicate,\n    Function<String, String> errorFunction) {\n    super(keyPredicate, errorFunction);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, ?> getMapProperty(Components components) {\n    return components.getRequestBodies();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"requestBodies\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsRequestBodiesValuesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.RequestBodyValidator;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.parameters.RequestBody;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.REQUEST_BODY;\n\npublic class ComponentsRequestBodiesValuesValidator extends MapPropertyValuesValidator<Components, RequestBody>\n  implements ComponentsValidator {\n\n  public ComponentsRequestBodiesValuesValidator(List<RequestBodyValidator> valueValidators) {\n    super(valueValidators);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, RequestBody> getMapProperty(Components components) {\n    return components.getRequestBodies();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"requestBodies\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return REQUEST_BODY;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsResponsesKeysValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyKeysValidator;\nimport io.swagger.v3.oas.models.Components;\n\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\npublic class ComponentsResponsesKeysValidator extends MapPropertyKeysValidator<Components>\n  implements ComponentsValidator {\n\n  public ComponentsResponsesKeysValidator(Predicate<String> keyPredicate,\n    Function<String, String> errorFunction) {\n    super(keyPredicate, errorFunction);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, ?> getMapProperty(Components components) {\n    return components.getResponses();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"responses\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsResponsesValuesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ResponseValidator;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.responses.ApiResponse;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.RESPONSE;\n\npublic class ComponentsResponsesValuesValidator extends MapPropertyValuesValidator<Components, ApiResponse>\n  implements ComponentsValidator {\n\n  public ComponentsResponsesValuesValidator(List<ResponseValidator> valueValidators) {\n    super(valueValidators);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, ApiResponse> getMapProperty(Components components) {\n    return components.getResponses();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"responses\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return RESPONSE;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsSchemasKeysValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyKeysValidator;\nimport io.swagger.v3.oas.models.Components;\n\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\npublic class ComponentsSchemasKeysValidator extends MapPropertyKeysValidator<Components>\n  implements ComponentsValidator {\n\n  public ComponentsSchemasKeysValidator(Predicate<String> keyPredicate,\n    Function<String, String> errorFunction) {\n    super(keyPredicate, errorFunction);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, ?> getMapProperty(Components components) {\n    return components.getSchemas();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"schemas\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsSchemasValuesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.SchemaValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SCHEMA;\n\npublic class ComponentsSchemasValuesValidator extends MapPropertyValuesValidator<Components, Schema>\n  implements ComponentsValidator {\n\n  public ComponentsSchemasValuesValidator(List<SchemaValidator> valueValidators) {\n    super(valueValidators);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, Schema> getMapProperty(Components components) {\n    return components.getSchemas();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"schemas\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return SCHEMA;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsSecuritySchemesKeysValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyKeysValidator;\nimport io.swagger.v3.oas.models.Components;\n\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\npublic class ComponentsSecuritySchemesKeysValidator extends MapPropertyKeysValidator<Components>\n  implements ComponentsValidator {\n\n  public ComponentsSecuritySchemesKeysValidator(Predicate<String> keyPredicate,\n    Function<String, String> errorFunction) {\n    super(keyPredicate, errorFunction);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, ?> getMapProperty(Components components) {\n    return components.getSecuritySchemes();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"securitySchemes\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/components/ComponentsSecuritySchemesValuesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.SecuritySchemeValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.security.SecurityScheme;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SECURITY_SCHEME;\n\npublic class ComponentsSecuritySchemesValuesValidator extends MapPropertyValuesValidator<Components, SecurityScheme>\n  implements ComponentsValidator {\n\n  public ComponentsSecuritySchemesValuesValidator(List<SecuritySchemeValidator> valueValidators) {\n    super(valueValidators);\n  }\n  @Override\n  protected String get$ref(Components oasObject) {\n    return null;\n  }\n  @Override\n  protected Map<String, SecurityScheme> getMapProperty(Components components) {\n    return components.getSecuritySchemes();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"securitySchemes\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return SECURITY_SCHEME;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/encoding/EncodingHeadersKeysValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.encoding;\n\nimport io.swagger.v3.oas.models.media.Encoding;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.EncodingValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyKeysValidator;\n\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#encodingObject\">Encoding Object</a>\n * .headers property key validator\n */\npublic class EncodingHeadersKeysValidator extends MapPropertyKeysValidator<Encoding>\n  implements EncodingValidator {\n\n  public EncodingHeadersKeysValidator(Predicate<String> keyPredicate,\n      Function<String, String> errorFunction) {\n    super(keyPredicate, errorFunction);\n  }\n\n  @Override\n  protected String get$ref(Encoding oasObject) {\n    return null;\n  }\n\n  @Override\n  protected Map<String, ?> getMapProperty(Encoding oasObject) {\n    return oasObject.getHeaders();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"headers\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/encoding/EncodingHeadersValuesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.EncodingValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.HeaderValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport io.swagger.v3.oas.models.headers.Header;\nimport io.swagger.v3.oas.models.media.Encoding;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.HEADER;\n\npublic class EncodingHeadersValuesValidator extends MapPropertyValuesValidator<Encoding, Header>\n  implements EncodingValidator {\n\n  public EncodingHeadersValuesValidator(List<HeaderValidator> valueValidators) {\n    super(valueValidators);\n  }\n\n  @Override\n  protected String get$ref(Encoding oasObject) {\n    return null;\n  }\n\n  @Override\n  protected Map<String, Header> getMapProperty(Encoding oasObject) {\n    return oasObject.getHeaders();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"headers\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return HEADER;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/header/HeaderSchemaValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.header;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.SchemaValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.HeaderValidator;\nimport io.swagger.v3.oas.models.headers.Header;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SCHEMA;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#headerObject\">Header Object</a>校验器\n * .schema property validator\n */\npublic class HeaderSchemaValidator extends ObjectPropertyValidator<Header, Schema> implements HeaderValidator {\n\n  public HeaderSchemaValidator(List<SchemaValidator> oasObjectValidators) {\n    super(oasObjectValidators);\n  }\n\n  @Override\n  protected String get$ref(Header oasObject) {\n    return oasObject.get$ref();\n  }\n\n  @Override\n  protected Schema getPropertyObject(Header oasObject) {\n    return oasObject.getSchema();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"schema\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return SCHEMA;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/mediatype/MediaTypeEncodingValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.mediatype;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.EncodingValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MediaTypeValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.media.Encoding;\nimport io.swagger.v3.oas.models.media.MediaType;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.ENCODING;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#media-type-object\">Media Type Object</a>\n * .encoding property value validator\n */\npublic class MediaTypeEncodingValidator extends MapPropertyValuesValidator<MediaType, Encoding>\n  implements MediaTypeValidator {\n\n  public MediaTypeEncodingValidator(List<EncodingValidator> encodingValidators) {\n    super(encodingValidators);\n  }\n\n  @Override\n  protected String get$ref(MediaType oasObject) {\n    return null;\n  }\n\n  @Override\n  protected Map<String, Encoding> getMapProperty(MediaType oasObject) {\n    return oasObject.getEncoding();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"encoding\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return ENCODING;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/mediatype/MediaTypeSchemaValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.mediatype;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MediaTypeValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.SchemaValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.media.MediaType;\nimport io.swagger.v3.oas.models.media.Schema;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SCHEMA;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#media-type-object\">Media Type Object</a>\n * .schema property validator\n */\npublic class MediaTypeSchemaValidator extends ObjectPropertyValidator<MediaType, Schema>\n  implements MediaTypeValidator {\n\n  public MediaTypeSchemaValidator(List<SchemaValidator> schemaValidators) {\n    super(schemaValidators);\n  }\n\n  @Override\n  protected String get$ref(MediaType oasObject) {\n    return null;\n  }\n\n  @Override\n  protected Schema getPropertyObject(MediaType oasObject) {\n    return oasObject.getSchema();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"schema\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return SCHEMA;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/openapi/OpenApiComponentsValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.openapi;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OpenApiValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyValidator;\nimport io.swagger.v3.oas.models.Components;\nimport io.swagger.v3.oas.models.OpenAPI;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.COMPONENTS;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#openapi-object\">OpenAPI Object</a>\n * .components(<a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a>)\n * validator\n */\npublic class OpenApiComponentsValidator extends ObjectPropertyValidator<OpenAPI, Components>\n  implements OpenApiValidator {\n\n\n  public OpenApiComponentsValidator(\n    List<ComponentsValidator> componentsValidators) {\n    super(componentsValidators);\n  }\n\n  @Override\n  protected String get$ref(OpenAPI oasObject) {\n    return null;\n  }\n\n  @Override\n  protected Components getPropertyObject(OpenAPI oasObject) {\n    return oasObject.getComponents();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"components\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return COMPONENTS;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/openapi/OpenApiInfoValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.openapi;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.InfoValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OpenApiValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyValidator;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.info.Info;\n\nimport java.util.List;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#openapi-object\">OpenAPI Object</a>\n * .info (<a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#infoObject\">Info Object</a>)\n * validator\n */\npublic class OpenApiInfoValidator extends ObjectPropertyValidator<OpenAPI, Info>\n  implements OpenApiValidator {\n\n  public OpenApiInfoValidator(List<InfoValidator> infoValidators) {\n    super(infoValidators);\n  }\n\n  @Override\n  protected String get$ref(OpenAPI oasObject) {\n    return null;\n  }\n\n  @Override\n  protected Info getPropertyObject(OpenAPI oasObject) {\n    return oasObject.getInfo();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"info\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return OasObjectType.INFO;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/openapi/OpenApiPathsValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.openapi;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OpenApiValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.PathsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyValidator;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.Paths;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PATHS;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#openapi-object\">OpenAPI Object</a>\n * .paths(<a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathsObject\">Paths Object</a>)\n * validator\n */\npublic class OpenApiPathsValidator extends ObjectPropertyValidator<OpenAPI, Paths>\n  implements OpenApiValidator {\n\n  public OpenApiPathsValidator(List<PathsValidator> pathsValidators) {\n\n    super(pathsValidators);\n  }\n\n  @Override\n  protected String get$ref(OpenAPI oasObject) {\n    return null;\n  }\n\n  @Override\n  protected Paths getPropertyObject(OpenAPI oasObject) {\n    return oasObject.getPaths();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"paths\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return PATHS;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/openapi/OpenApiServersValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.openapi;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OpenApiValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ServerValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ListPropertyValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.servers.Server;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SERVER;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#openapi-object\">OpenAPI Object</a>\n * .servers(List of <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#serverObject\">Server Object</a>)\n * validator\n */\npublic class OpenApiServersValidator extends ListPropertyValidator<OpenAPI, Server>\n  implements OpenApiValidator {\n\n  public OpenApiServersValidator(List<ServerValidator> serverValidators) {\n    super(serverValidators);\n  }\n\n  @Override\n  protected String get$ref(OpenAPI oasObject) {\n    return null;\n  }\n\n  @Override\n  protected List<Server> getListProperty(OpenAPI oasObject) {\n    return oasObject.getServers();\n  }\n\n  @Override\n  protected String getListPropertyName() {\n    return \"servers\";\n  }\n\n  @Override\n  protected OasObjectType getElementType() {\n    return SERVER;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/openapi/OpenApiTagsValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.openapi;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OpenApiValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.TagValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ListPropertyValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.tags.Tag;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.TAG;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#openapi-object\">OpenAPI Object</a>\n * .tags(List of <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#tagObject\">Tag Object</a>)\n * validator\n */\npublic class OpenApiTagsValidator extends ListPropertyValidator<OpenAPI, Tag>\n  implements OpenApiValidator {\n\n  public OpenApiTagsValidator(List<TagValidator> tagValidators) {\n    super(tagValidators);\n  }\n\n  @Override\n  protected String get$ref(OpenAPI oasObject) {\n    return null;\n  }\n\n  @Override\n  protected List<Tag> getListProperty(OpenAPI oasObject) {\n    return oasObject.getTags();\n  }\n\n  @Override\n  protected String getListPropertyName() {\n    return \"tags\";\n  }\n\n  @Override\n  protected OasObjectType getElementType() {\n    return TAG;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/operation/OperationParametersValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.operation;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OperationValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ListPropertyValidator;\nimport io.swagger.v3.oas.models.Operation;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PARAMETER;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\">Operation Object</a>\n * .parameters property validator\n */\npublic class OperationParametersValidator extends ListPropertyValidator<Operation, Parameter>\n  implements OperationValidator {\n\n  public OperationParametersValidator(List<ParameterValidator> parameterValidators) {\n    super(parameterValidators);\n  }\n\n  @Override\n  protected String get$ref(Operation oasObject) {\n    return null;\n  }\n\n  @Override\n  protected List<Parameter> getListProperty(Operation oasObject) {\n    return oasObject.getParameters();\n  }\n\n  @Override\n  protected String getListPropertyName() {\n    return \"parameters\";\n  }\n\n  @Override\n  protected OasObjectType getElementType() {\n    return PARAMETER;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/operation/OperationRequestBodyValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.operation;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OperationValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.RequestBodyValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyValidator;\nimport io.swagger.v3.oas.models.Operation;\nimport io.swagger.v3.oas.models.parameters.RequestBody;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.REQUEST_BODY;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\">Operation Object</a>\n * .requestBody property validator\n */\npublic class OperationRequestBodyValidator extends ObjectPropertyValidator<Operation, RequestBody>\n  implements OperationValidator {\n\n  public OperationRequestBodyValidator(\n    List<RequestBodyValidator> requestBodyValidators) {\n    super(requestBodyValidators);\n  }\n\n  @Override\n  protected String get$ref(Operation oasObject) {\n    return null;\n  }\n\n  @Override\n  protected RequestBody getPropertyObject(Operation oasObject) {\n    return oasObject.getRequestBody();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"requestBody\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return REQUEST_BODY;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/operation/OperationResponsesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.operation;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OperationValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ResponsesValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyValidator;\nimport io.swagger.v3.oas.models.Operation;\nimport io.swagger.v3.oas.models.responses.ApiResponses;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.RESPONSES;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\">Operation Object</a>\n * .responses property validator\n */\npublic class OperationResponsesValidator extends ObjectPropertyValidator<Operation, ApiResponses>\n  implements OperationValidator {\n\n  public OperationResponsesValidator(List<ResponsesValidator> responseValidators) {\n    super(responseValidators);\n  }\n\n  @Override\n  protected String get$ref(Operation oasObject) {\n    return null;\n  }\n\n  @Override\n  protected ApiResponses getPropertyObject(Operation oasObject) {\n    return oasObject.getResponses();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"responses\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return RESPONSES;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/parameter/ParameterContentValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MediaTypeValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport io.swagger.v3.oas.models.media.MediaType;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.MEDIA_TYPE;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject\">Parameter Object</a>属性校验器\n * .content property validator\n */\npublic class ParameterContentValidator extends MapPropertyValuesValidator<Parameter, MediaType>\n  implements ParameterValidator {\n\n  public ParameterContentValidator(List<MediaTypeValidator> mediaTypeValidators) {\n    super(mediaTypeValidators);\n  }\n\n  @Override\n  protected String get$ref(Parameter oasObject) {\n    return oasObject.get$ref();\n  }\n\n  @Override\n  protected Map<String, MediaType> getMapProperty(Parameter oasObject) {\n    return oasObject.getContent();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"content\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return MEDIA_TYPE;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/parameter/ParameterSchemaValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.SchemaValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyValidator;\nimport io.swagger.v3.oas.models.media.Schema;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SCHEMA;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject\">Parameter Object</a>属性校验器\n * .schema property validator\n */\npublic class ParameterSchemaValidator extends ObjectPropertyValidator<Parameter, Schema>\n  implements ParameterValidator {\n\n  public ParameterSchemaValidator(\n    List<SchemaValidator> schemaValidators) {\n    super(schemaValidators);\n  }\n\n  @Override\n  protected String get$ref(Parameter oasObject) {\n    return oasObject.get$ref();\n  }\n\n  @Override\n  protected Schema getPropertyObject(Parameter oasObject) {\n    return oasObject.getSchema();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"schema\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return SCHEMA;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/pathitem/PathItemOperationsValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.pathitem;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.util.OasObjectValidatorUtils;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.*;\nimport io.swagger.v3.oas.models.Operation;\nimport io.swagger.v3.oas.models.PathItem;\nimport org.apache.commons.lang3.StringUtils;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\nimport static java.util.Collections.emptyList;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathItemObject\">Path Item Object</a>\n * .get / .put / .post / .delete / .options / .head / .patch / .trace\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\">Operation Object</a>\n * validator\n */\npublic class PathItemOperationsValidator implements PathItemValidator {\n\n  private final List<OperationValidator> operationValidators;\n\n  public PathItemOperationsValidator(List<OperationValidator> operationValidators) {\n    this.operationValidators = operationValidators;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    PathItem oasObject) {\n    if (StringUtils.isNotBlank(oasObject.get$ref())) {\n      return emptyList();\n    }\n\n    List<OasViolation> violations = new ArrayList<>();\n\n    Map<PathItem.HttpMethod, Operation> operationMap = oasObject.readOperationsMap();\n\n    for (Map.Entry<PathItem.HttpMethod, Operation> entry : operationMap.entrySet()) {\n      PathItem.HttpMethod method = entry.getKey();\n      Operation operation = entry.getValue();\n      OasObjectPropertyLocation operationLocation = location.property(method.toString().toLowerCase(), OasObjectType.OPERATION);\n      violations.addAll(\n        OasObjectValidatorUtils.doValidateProperty(context, operationLocation, operation, operationValidators));\n    }\n    return violations;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/pathitem/PathItemParametersValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.pathitem;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ListPropertyValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.PathItemValidator;\nimport io.swagger.v3.oas.models.PathItem;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PARAMETER;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathItemObject\">Path Item Object</a>\n * .parameters (List of <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject\">Parameter Object</a>)\n * validator\n */\npublic class PathItemParametersValidator extends ListPropertyValidator<PathItem, Parameter>\n  implements PathItemValidator {\n\n  public PathItemParametersValidator(List<ParameterValidator> parameterValidators) {\n    super(parameterValidators);\n  }\n\n  @Override\n  protected String get$ref(PathItem oasObject) {\n    return oasObject.get$ref();\n  }\n\n  @Override\n  protected List<Parameter> getListProperty(PathItem oasObject) {\n    return oasObject.getParameters();\n  }\n\n  @Override\n  protected String getListPropertyName() {\n    return \"parameters\";\n  }\n\n  @Override\n  protected OasObjectType getElementType() {\n    return PARAMETER;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/paths/PathsPathItemsValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.paths;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.PathItemValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.PathsValidator;\nimport io.swagger.v3.oas.models.PathItem;\nimport io.swagger.v3.oas.models.Paths;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.validation.util.OasObjectValidatorUtils.doValidateProperty;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathsObject\">Paths Object</a>\n * /{path} (Map [String, <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathItemObject\">Path Item Object</a>])\n * validator\n */\npublic class PathsPathItemsValidator implements PathsValidator {\n\n  private final List<PathItemValidator> pathItemValidators;\n\n  public PathsPathItemsValidator(List<PathItemValidator> pathItemValidators) {\n    this.pathItemValidators = pathItemValidators;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location, Paths oasObject) {\n    List<OasViolation> violations = new ArrayList<>();\n\n    for (Map.Entry<String, PathItem> entry : oasObject.entrySet()) {\n      String path = entry.getKey();\n      PathItem pathItem = entry.getValue();\n      OasObjectPropertyLocation pathItemLocation = location.property(path, OasObjectType.PATH_ITEM);\n      violations.addAll(doValidateProperty(context, pathItemLocation, pathItem, pathItemValidators));\n    }\n\n    return violations;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/requestbody/RequestBodyContentValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.requestbody;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MediaTypeValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.RequestBodyValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport io.swagger.v3.oas.models.media.MediaType;\nimport io.swagger.v3.oas.models.parameters.RequestBody;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.MEDIA_TYPE;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#request-body-object\">Request Object</a>\n * .content property value validator\n */\npublic class RequestBodyContentValidator\n  extends MapPropertyValuesValidator<RequestBody, MediaType>\n  implements RequestBodyValidator {\n\n  public RequestBodyContentValidator(List<MediaTypeValidator> mediaTypeValidators) {\n    super(mediaTypeValidators);\n  }\n\n  @Override\n  protected String get$ref(RequestBody oasObject) {\n    return oasObject.get$ref();\n  }\n\n  @Override\n  protected Map<String, MediaType> getMapProperty(RequestBody oasObject) {\n    return oasObject.getContent();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"content\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return MEDIA_TYPE;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/response/ResponseContentValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.response;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MediaTypeValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.media.MediaType;\nimport io.swagger.v3.oas.models.responses.ApiResponse;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.MEDIA_TYPE;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responseObject\">Response Object</a>\n * .content property value validator\n */\npublic class ResponseContentValidator extends MapPropertyValuesValidator<ApiResponse, MediaType>\n  implements ResponseValidator {\n\n  public ResponseContentValidator(List<MediaTypeValidator> mediaTypeValidators) {\n    super(mediaTypeValidators);\n  }\n\n  @Override\n  protected String get$ref(ApiResponse oasObject) {\n    return oasObject.get$ref();\n  }\n\n  @Override\n  protected Map<String, MediaType> getMapProperty(ApiResponse oasObject) {\n    return oasObject.getContent();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"content\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return MEDIA_TYPE;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/response/ResponseHeadersKeysValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.response;\n\nimport io.swagger.v3.oas.models.responses.ApiResponse;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyKeysValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ResponseValidator;\n\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">ApiResponse Object</a>\n * .headers property key validator\n */\npublic class ResponseHeadersKeysValidator extends MapPropertyKeysValidator<ApiResponse>\n  implements ResponseValidator {\n\n  public ResponseHeadersKeysValidator(Predicate<String> keyPredicate,\n      Function<String, String> errorFunction) {\n    super(keyPredicate, errorFunction);\n  }\n\n  @Override\n  protected String get$ref(ApiResponse oasObject) {\n    return oasObject.get$ref();\n  }\n\n  @Override\n  protected Map<String, ?> getMapProperty(ApiResponse oasObject) {\n    return oasObject.getHeaders();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"headers\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/response/ResponseHeadersValuesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.response;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.HeaderValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MapPropertyValuesValidator;\nimport io.swagger.v3.oas.models.headers.Header;\nimport io.swagger.v3.oas.models.responses.ApiResponse;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.HEADER;\n\npublic class ResponseHeadersValuesValidator extends MapPropertyValuesValidator<ApiResponse, Header>\n  implements ResponseValidator {\n\n  public ResponseHeadersValuesValidator(List<HeaderValidator> valueValidators) {\n    super(valueValidators);\n  }\n\n  @Override\n  protected String get$ref(ApiResponse oasObject) {\n    return oasObject.get$ref();\n  }\n\n  @Override\n  protected Map<String, Header> getMapProperty(ApiResponse components) {\n    return components.getHeaders();\n  }\n\n  @Override\n  protected String getMapPropertyName() {\n    return \"headers\";\n  }\n\n  @Override\n  protected OasObjectType getValueType() {\n    return HEADER;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/responses/ResponsesResponsesValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.responses;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ResponsesValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.util.OasObjectValidatorUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport io.swagger.v3.oas.models.responses.ApiResponse;\nimport io.swagger.v3.oas.models.responses.ApiResponses;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responsesObject\">Responses Object</a>\n * .default / .{Http Status Code} property validator\n */\npublic class ResponsesResponsesValidator implements ResponsesValidator {\n\n  private final List<ResponseValidator> responseValidators;\n\n  public ResponsesResponsesValidator(List<ResponseValidator> responseValidators) {\n    this.responseValidators = responseValidators;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    ApiResponses oasObject) {\n\n    List<OasViolation> violations = new ArrayList<>();\n\n    for (Map.Entry<String, ApiResponse> entry : oasObject.entrySet()) {\n      String statusCode = entry.getKey();\n      ApiResponse response = entry.getValue();\n      OasObjectPropertyLocation responseLoc = location.property(statusCode, OasObjectType.RESPONSE);\n      violations.addAll(OasObjectValidatorUtils.doValidateProperty(context, responseLoc, response, responseValidators));\n    }\n\n    return violations;\n\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/schema/SchemaPropertiesKeysValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.util.OasObjectValidatorUtils;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.collections4.MapUtils;\n\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\nimport static java.util.Collections.emptyList;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject\">Schema Object</a>\n * .properties property key validator\n */\npublic class SchemaPropertiesKeysValidator\n  extends SchemaRecursiveValidatorTemplate {\n\n  private final Predicate<String> keyPredicate;\n\n  private final Function<String, String> errorFunction;\n\n  public SchemaPropertiesKeysValidator(Predicate<String> keyPredicate,\n    Function<String, String> errorFunction) {\n    this.keyPredicate = keyPredicate;\n    this.errorFunction = errorFunction;\n  }\n\n  @Override\n  protected List<OasViolation> validateCurrentSchemaObject(OasValidationContext context, Schema oasObject,\n    OasObjectPropertyLocation location) {\n\n    Map<String, Schema> properties = oasObject.getProperties();\n\n    if (MapUtils.isEmpty(properties)) {\n      return emptyList();\n    }\n\n    return\n      OasObjectValidatorUtils.doValidateMapPropertyKeys(\n        location,\n        \"properties\",\n        properties,\n        keyPredicate,\n        errorFunction\n      );\n\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/skeleton/schema/SchemaRecursiveValidatorTemplate.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.skeleton.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.SchemaValidator;\nimport io.swagger.v3.oas.models.media.ArraySchema;\nimport io.swagger.v3.oas.models.media.ComposedSchema;\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.StringUtils;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SCHEMA;\nimport static org.apache.servicecomb.toolkit.oasv.validation.util.OasObjectValidatorUtils.doValidateListProperty;\nimport static org.apache.servicecomb.toolkit.oasv.validation.util.OasObjectValidatorUtils.doValidateMapPropertyValues;\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\n/**\n * Template for recursively validate current Schema Object and Schema Object appears in its properties\n */\npublic abstract class SchemaRecursiveValidatorTemplate implements SchemaValidator {\n\n  @Override\n  public final List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    Schema oasObject) {\n\n    if (StringUtils.isNotBlank(oasObject.get$ref())) {\n      return emptyList();\n    }\n    if (oasObject instanceof ComposedSchema) {\n      return validateComposedSchema(context, (ComposedSchema) oasObject, location);\n    }\n    if (oasObject instanceof ArraySchema) {\n      return validateArraySchema(context, (ArraySchema) oasObject, location);\n    }\n    return validateOrdinarySchema(context, oasObject, location);\n\n  }\n\n  private List<OasViolation> validateOrdinarySchema(OasValidationContext context, Schema oasObject,\n    OasObjectPropertyLocation location) {\n\n    List<OasViolation> violations = new ArrayList<>();\n    violations.addAll(validateCurrentSchemaObject(context, oasObject, location));\n\n    violations.addAll(\n      doValidateMapPropertyValues(\n        context,\n        location,\n        \"properties\",\n        oasObject.getProperties(),\n        SCHEMA,\n        singletonList(this)\n      )\n    );\n\n    return violations;\n\n  }\n\n  private List<OasViolation> validateArraySchema(OasValidationContext context, ArraySchema oasObject,\n    OasObjectPropertyLocation location) {\n    return validate(context, location.property(\"items\", SCHEMA), oasObject.getItems());\n  }\n\n  private List<OasViolation> validateComposedSchema(OasValidationContext context, ComposedSchema oasObject,\n    OasObjectPropertyLocation location) {\n\n    List<OasViolation> violations = new ArrayList<>();\n\n    violations.addAll(\n      doValidateListProperty(\n        context, location,\n        \"allOf\",\n        oasObject.getAllOf(),\n        SCHEMA,\n        singletonList(this)\n      )\n    );\n\n    violations.addAll(\n      doValidateListProperty(\n        context, location,\n        \"anyOf\",\n        oasObject.getAnyOf(),\n        SCHEMA,\n        singletonList(this)\n      )\n    );\n\n    violations.addAll(\n      doValidateListProperty(\n        context, location,\n        \"oneOf\",\n        oasObject.getOneOf(),\n        SCHEMA,\n        singletonList(this)\n      )\n    );\n\n    return violations;\n  }\n\n  protected abstract List<OasViolation> validateCurrentSchemaObject(OasValidationContext context, Schema oasObject,\n    OasObjectPropertyLocation location);\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/util/OasObjectValidatorUtils.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.util;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.*;\nimport org.apache.commons.collections4.CollectionUtils;\nimport org.apache.commons.collections4.MapUtils;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\nimport static java.util.Collections.emptyList;\n\npublic abstract class OasObjectValidatorUtils {\n\n  private OasObjectValidatorUtils() {\n    // singleton\n  }\n\n  /**\n   * @param context\n   * @param propertyLoc\n   * @param propertyObject\n   * @param validators\n   * @param <T>\n   * @return\n   */\n  public static <T> List<OasViolation> doValidateProperty(\n    OasValidationContext context,\n    OasObjectPropertyLocation propertyLoc,\n    T propertyObject,\n    List<? extends OasObjectValidator<T>> validators) {\n\n    List<OasViolation> violations = new ArrayList<>();\n    for (OasObjectValidator validator : validators) {\n      violations.addAll(validator.validate(context, propertyLoc, propertyObject));\n    }\n    return violations;\n  }\n\n  /**\n   * @param <T>\n   * @param context\n   * @param ownerLocation    location of owner OAS object who own this listProperty\n   * @param listPropertyName listProperty name appears in owner OAS object\n   * @param listProperty     null-safe\n   * @param elementType      type of elements in listProperty\n   * @param validators\n   * @return\n   */\n  public static <T> List<OasViolation> doValidateListProperty(\n    OasValidationContext context,\n    OasObjectPropertyLocation ownerLocation,\n    String listPropertyName,\n    List<T> listProperty,\n    OasObjectType elementType,\n    List<? extends OasObjectValidator<T>> validators) {\n\n    if (CollectionUtils.isEmpty(listProperty)) {\n      return emptyList();\n    }\n\n    List<OasViolation> violations = new ArrayList<>();\n    for (int i = 0; i < listProperty.size(); i++) {\n      T object = listProperty.get(i);\n      String elementName = listPropertyName + \"[\" + i + \"]\";\n      OasObjectPropertyLocation elementLoc = ownerLocation.property(elementName, elementType);\n      violations.addAll(doValidateProperty(context, elementLoc, object, validators));\n    }\n    return violations;\n\n  }\n\n  /**\n   * @param ownerLocation   location of owner OAS object who own this mapProperty\n   * @param mapPropertyName mapProperty name appears in owner OAS object\n   * @param mapProperty     null-safe\n   * @param keyPredicate\n   * @param errorMessage\n   * @param <T>\n   * @return\n   */\n  public static <T> List<OasViolation> doValidateMapPropertyKeys(\n    OasObjectPropertyLocation ownerLocation,\n    String mapPropertyName,\n    Map<String, T> mapProperty,\n    Predicate<String> keyPredicate,\n    Function<String, String> errorMessage\n  ) {\n\n    if (MapUtils.isEmpty(mapProperty)) {\n      return emptyList();\n    }\n\n    List<OasViolation> violations = new ArrayList<>();\n\n    for (Map.Entry<String, T> entry : mapProperty.entrySet()) {\n      String key = entry.getKey();\n      String keyName = mapPropertyName + \".'\" + key + \"'\";\n\n      OasObjectPropertyLocation keyLoc = ownerLocation.property(keyName);\n\n      if (!keyPredicate.test(key)) {\n        violations.add(new OasViolation(keyLoc, errorMessage.apply(key)));\n      }\n\n    }\n\n    return violations;\n  }\n\n  /**\n   * @param <T>\n   * @param context\n   * @param ownerLocation   location of owner OAS object who own this mapProperty\n   * @param mapPropertyName mapProperty name appears in owner OAS object\n   * @param mapProperty     null-safe\n   * @param valueType       type of values in mapProperty\n   * @param validators\n   * @return\n   */\n  public static <T> List<OasViolation> doValidateMapPropertyValues(\n    OasValidationContext context,\n    OasObjectPropertyLocation ownerLocation,\n    String mapPropertyName,\n    Map<String, T> mapProperty,\n    OasObjectType valueType,\n    List<? extends OasObjectValidator<T>> validators\n  ) {\n\n    if (MapUtils.isEmpty(mapProperty)) {\n      return emptyList();\n    }\n\n    List<OasViolation> violations = new ArrayList<>();\n\n    for (Map.Entry<String, T> entry : mapProperty.entrySet()) {\n      String key = entry.getKey();\n      T value = entry.getValue();\n\n      String keyName = mapPropertyName + \".'\" + key + \"'\";\n      OasObjectPropertyLocation valueLoc = ownerLocation.property(keyName, valueType);\n      violations.addAll(doValidateProperty(context, valueLoc, value, validators));\n    }\n\n    return violations;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/test/java/org/apache/servicecomb/toolkit/oasv/common/OasObjectPropertyLocationTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.common;\n\nimport static org.junit.Assert.assertEquals;\n\nimport org.junit.Test;\n\npublic class OasObjectPropertyLocationTest {\n\n  @Test\n  public void toPathString() {\n    assertEquals(\"$.foo.bar\",\n        OasObjectPropertyLocation.toPathString(OasObjectPropertyLocation.root().property(\"foo\").property(\"bar\")));\n\n    assertEquals(\"\", OasObjectPropertyLocation.toPathString(null));\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/test/java/org/apache/servicecomb/toolkit/oasv/util/StringCaseUtilsTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.util;\n\nimport org.junit.Test;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class StringCaseUtilsTest {\n\n  @Test\n  public void isLowerCamelCase() {\n\n    assertThat(StringCaseUtils.isLowerCamelCase(\"\")).isFalse();\n\n    assertThat(StringCaseUtils.isLowerCamelCase(\"A\")).isFalse();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"A0\")).isFalse();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"Aa\")).isFalse();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"AA\")).isFalse();\n\n    assertThat(StringCaseUtils.isLowerCamelCase(\"0\")).isFalse();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"00\")).isFalse();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"0a\")).isFalse();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"0A\")).isFalse();\n\n    assertThat(StringCaseUtils.isLowerCamelCase(\"a\")).isTrue();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"a0\")).isTrue();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aa\")).isTrue();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aA\")).isTrue();\n\n    assertThat(StringCaseUtils.isLowerCamelCase(\"a00\")).isTrue();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"a0a\")).isTrue();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"a0A\")).isTrue();\n\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aa0\")).isTrue();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aaa\")).isTrue();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aaA\")).isTrue();\n\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aaA0\")).isTrue();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aaAa\")).isTrue();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aaAA\")).isFalse();\n\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aaA00\")).isTrue();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aaA0a\")).isTrue();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aaA0A\")).isTrue();\n\n    assertThat(StringCaseUtils.isLowerCamelCase(\"_aaA00\")).isFalse();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"a_aA00\")).isFalse();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aa_A00\")).isFalse();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aaA_00\")).isFalse();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aaA0_0\")).isFalse();\n    assertThat(StringCaseUtils.isLowerCamelCase(\"aaA00_\")).isFalse();\n\n  }\n\n  @Test\n  public void isUpperCamelCase() {\n\n    assertThat(StringCaseUtils.isUpperCamelCase(\"\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperCamelCase(\"A\")).isTrue();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"A0\")).isTrue();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"Aa\")).isTrue();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"AA\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperCamelCase(\"0\")).isFalse();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"00\")).isFalse();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"0a\")).isFalse();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"0A\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperCamelCase(\"a\")).isFalse();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"a0\")).isFalse();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"aa\")).isFalse();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"aA\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperCamelCase(\"A00\")).isTrue();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"A0a\")).isTrue();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"A0A\")).isTrue();\n\n    assertThat(StringCaseUtils.isUpperCamelCase(\"Aa0\")).isTrue();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"Aaa\")).isTrue();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"AaA\")).isTrue();\n\n    assertThat(StringCaseUtils.isUpperCamelCase(\"AaA0\")).isTrue();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"AaAa\")).isTrue();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"AaAA\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperCamelCase(\"AaA00\")).isTrue();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"AaA0a\")).isTrue();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"AaA0A\")).isTrue();\n\n    assertThat(StringCaseUtils.isUpperCamelCase(\"_aaA00\")).isFalse();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"a_aA00\")).isFalse();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"aa_A00\")).isFalse();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"aaA_00\")).isFalse();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"aaA0_0\")).isFalse();\n    assertThat(StringCaseUtils.isUpperCamelCase(\"aaA00_\")).isFalse();\n\n  }\n\n  @Test\n  public void isUpperHyphenCase() {\n\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A\")).isTrue();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A0\")).isTrue();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"Aa\")).isTrue();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"AA\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"0\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"00\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"0a\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"0A\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"a\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"a0\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"aa\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"aA\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A00\")).isTrue();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A0a\")).isTrue();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A0A\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A-A\")).isTrue();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A-a\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A-0\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A-AA\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"AA-A\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"AA-a\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"AA-0\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"Aa-A\")).isTrue();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"Aa-Aa\")).isTrue();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"Aa-A0\")).isTrue();\n\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A0-A\")).isTrue();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A0-Aa\")).isTrue();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A0-A0\")).isTrue();\n\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A0-a0\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A0-aa\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A0-aA\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A0-0\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A0-00\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A0-0a\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"A0-0A\")).isFalse();\n\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"_aaA00\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"a_aA00\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"aa_A00\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"aaA_00\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"aaA0_0\")).isFalse();\n    assertThat(StringCaseUtils.isUpperHyphenCase(\"aaA00_\")).isFalse();\n\n  }\n\n  @Test\n  public void testIsMatchCase() {\n\n    assertThat(StringCaseUtils.isMatchCase(\"lower-camel-case\", \"a0\")).isTrue();\n    assertThat(StringCaseUtils.isMatchCase(\"upper-camel-case\", \"A0\")).isTrue();\n    assertThat(StringCaseUtils.isMatchCase(\"upper-hyphen-case\", \"A-A\")).isTrue();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/test/java/org/apache/servicecomb/toolkit/oasv/util/SyntaxCheckerTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.util;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.junit.Assert.*;\n\nimport java.util.List;\n\nimport org.junit.Test;\n\nimport io.swagger.v3.parser.util.ClasspathHelper;\n\npublic class SyntaxCheckerTest {\n\n  @Test\n  public void checkGood() {\n    String yaml = loadRelative(\"syntax-good.yaml\");\n    List<String> errors = SyntaxChecker.check(yaml);\n    assertThat(errors).isEmpty();\n  }\n\n  @Test\n  public void checkBad() {\n    String yaml = loadRelative(\"syntax-bad.yaml\");\n    List<String> errors = SyntaxChecker.check(yaml);\n    assertThat(errors).containsExactly(\"attribute paths.'/pets'(post).summary2 is unexpected\");\n  }\n\n  private String loadRelative(String filename) {\n    String basePath = getClass().getPackage().getName().replaceAll(\"\\\\.\", \"/\");\n    return ClasspathHelper.loadFileFromClasspath(basePath + \"/\" + filename);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/test/resources/org/apache/servicecomb/toolkit/oasv/util/syntax-bad.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Pet petstore\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary2: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-core/src/test/resources/org/apache/servicecomb/toolkit/oasv/util/syntax-good.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Pet petstore\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-core-spring/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n  <parent>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>oas-validator-parent</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <relativePath>../pom.xml</relativePath>\n  </parent>\n\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>oas-validator-core-spring</artifactId>\n\n  <dependencies>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-core</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter</artifactId>\n    </dependency>\n\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-plugin</artifactId>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-report-plugin</artifactId>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>\n"
  },
  {
    "path": "oas-validator/oas-validator-core-spring/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/config/OasDiffValidatorsSkeletonConfiguration.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.config;\n\nimport java.util.List;\n\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.CallbackDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ComponentsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.DefaultOasSpecDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.EncodingDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.HeaderDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.InfoDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.LinkDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.MediaTypeDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasSpecDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OpenApiDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OperationDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ParameterDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.PathItemDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.PathsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.RequestBodyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ResponseDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ResponsesDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaAddValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaDelValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.ServerDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.TagDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components.ComponentsCallbacksDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components.ComponentsHeadersDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components.ComponentsLinksDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components.ComponentsParametersDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components.ComponentsRequestBodiesDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.components.ComponentsResponsesDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.encoding.EncodingHeadersDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.header.HeaderSchemaDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.mediatype.MediaTypeEncodingDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.mediatype.MediaTypeSchemaDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi.OpenApiComponentsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi.OpenApiInfoDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi.OpenApiPathsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi.OpenApiServersDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.openapi.OpenApiTagsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.operation.OperationParametersDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.operation.OperationRequestBodyDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.operation.OperationResponsesDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.parameter.ParameterContentDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.parameter.ParameterSchemaDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.pathitem.PathItemOperationsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.pathitem.PathItemParametersDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.paths.PathsPathItemsDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.requestbody.RequestBodyContentDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.response.ResponseContentDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.response.ResponseHeadersDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.responses.ResponsesResponsesDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.skeleton.schema.SchemaDiffValidatorEngine;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\npublic class OasDiffValidatorsSkeletonConfiguration {\n\n  @Bean\n  public OasSpecDiffValidator oasSpecDiffValidator(List<OpenApiDiffValidator> openApiDiffValidators) {\n    return new DefaultOasSpecDiffValidator(openApiDiffValidators);\n  }\n\n  @Bean\n  public ComponentsDiffValidator componentsCallbacksDiffValidator(\n    List<CallbackDiffValidator> diffValidators) {\n    return new ComponentsCallbacksDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public ComponentsDiffValidator componentsHeadersDiffValidator(\n    List<HeaderDiffValidator> diffValidators) {\n    return new ComponentsHeadersDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public ComponentsDiffValidator componentsLinksDiffValidator(\n    List<LinkDiffValidator> diffValidators) {\n    return new ComponentsLinksDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public ComponentsDiffValidator componentsParametersDiffValidator(\n    List<ParameterDiffValidator> diffValidators) {\n    return new ComponentsParametersDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public ComponentsDiffValidator componentsRequestBodiesDiffValidator(\n    List<RequestBodyDiffValidator> diffValidators) {\n    return new ComponentsRequestBodiesDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public ComponentsDiffValidator componentsResponsesDiffValidator(\n    List<ResponseDiffValidator> diffValidators) {\n    return new ComponentsResponsesDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public EncodingDiffValidator encodingHeadersDiffValidator(\n    List<HeaderDiffValidator> diffValidators) {\n    return new EncodingHeadersDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public HeaderDiffValidator headerSchemaDiffValidator(\n    List<SchemaDiffValidator> diffValidators) {\n    return new HeaderSchemaDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public MediaTypeDiffValidator mediaTypeEncodingDiffValidator(\n    List<EncodingDiffValidator> diffValidators) {\n    return new MediaTypeEncodingDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public MediaTypeDiffValidator mediaTypeSchemaDiffValidator(\n    List<SchemaDiffValidator> diffValidators) {\n    return new MediaTypeSchemaDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public OpenApiDiffValidator openApiComponentsDiffValidator(\n    List<ComponentsDiffValidator> diffValidators) {\n    return new OpenApiComponentsDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public OpenApiDiffValidator openApiInfoDiffValidator(\n    List<InfoDiffValidator> diffValidators) {\n    return new OpenApiInfoDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public OpenApiDiffValidator openApiPathsDiffValidator(\n    List<PathsDiffValidator> diffValidators) {\n    return new OpenApiPathsDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public OpenApiDiffValidator openApiServersDiffValidator(\n    List<ServerDiffValidator> diffValidators) {\n    return new OpenApiServersDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public OpenApiDiffValidator openApiTagsDiffValidator(\n    List<TagDiffValidator> diffValidators) {\n    return new OpenApiTagsDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public OperationDiffValidator operationParametersDiffValidator(\n    List<ParameterDiffValidator> diffValidators) {\n    return new OperationParametersDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public OperationDiffValidator operationRequestBodyDiffValidator(\n    List<RequestBodyDiffValidator> diffValidators) {\n    return new OperationRequestBodyDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public OperationDiffValidator operationResponsesDiffValidator(\n    List<ResponsesDiffValidator> diffValidators) {\n    return new OperationResponsesDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public ParameterDiffValidator parameterContentDiffValidator(\n    List<MediaTypeDiffValidator> diffValidators) {\n    return new ParameterContentDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public ParameterDiffValidator parameterSchemaDiffValidator(\n    List<SchemaDiffValidator> diffValidators) {\n    return new ParameterSchemaDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public PathItemDiffValidator pathItemOperationsDiffValidator(\n    List<OperationDiffValidator> diffValidators) {\n    return new PathItemOperationsDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public PathItemDiffValidator pathItemParametersDiffValidator(\n    List<ParameterDiffValidator> diffValidators) {\n    return new PathItemParametersDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public PathsDiffValidator pathsPathItemsDiffValidator(\n    List<PathItemDiffValidator> diffValidators) {\n    return new PathsPathItemsDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public RequestBodyDiffValidator requestBodyContentDiffValidator(\n    List<MediaTypeDiffValidator> diffValidators) {\n    return new RequestBodyContentDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public ResponseDiffValidator responseContentDiffValidator(\n    List<MediaTypeDiffValidator> diffValidators) {\n    return new ResponseContentDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public ResponseDiffValidator responseHeadersDiffValidator(\n    List<HeaderDiffValidator> diffValidators) {\n    return new ResponseHeadersDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public ResponsesDiffValidator responsesResponsesDiffValidator(\n    List<ResponseDiffValidator> diffValidators) {\n    return new ResponsesResponsesDiffValidator(diffValidators);\n  }\n\n  @Bean\n  public SchemaDiffValidator schemaDiffValidatorEngine(\n    List<SchemaAddValidator> schemaNewValidators,\n    List<SchemaDelValidator> schemaDelValidators,\n    List<SchemaCompareValidator> schemaCompareValidators) {\n    return new SchemaDiffValidatorEngine(schemaNewValidators, schemaDelValidators, schemaCompareValidators);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-core-spring/src/main/resources/META-INF/spring.factories",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\norg.springframework.boot.autoconfigure.EnableAutoConfiguration=\\\norg.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration\n"
  },
  {
    "path": "oas-validator/oas-validator-style/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n  <parent>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>oas-validator-parent</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <relativePath>../pom.xml</relativePath>\n  </parent>\n\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>oas-validator-style</artifactId>\n\n  <properties>\n    <log4j2.version>2.11.0</log4j2.version>\n  </properties>\n\n  <dependencies>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-core</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-context</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.slf4j</groupId>\n      <artifactId>slf4j-api</artifactId>\n      <scope>provided</scope>\n    </dependency>\n    \n    <!-- test deps -->\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-test</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-test</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-plugin</artifactId>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-report-plugin</artifactId>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/StyleCheckParser.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style;\n\nimport io.swagger.v3.parser.OpenAPIV3Parser;\nimport io.swagger.v3.parser.core.models.ParseOptions;\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\n\npublic abstract class StyleCheckParser {\n\n  private StyleCheckParser() {\n    // singleton\n  }\n\n  public static SwaggerParseResult parseYaml(String yaml) {\n    OpenAPIV3Parser parser = new OpenAPIV3Parser();\n    return parser.readContents(yaml, null, createParseOptions());\n  }\n\n  private static ParseOptions createParseOptions() {\n\n    ParseOptions parseOptions = new ParseOptions();\n    parseOptions.setResolve(true);\n    parseOptions.setResolveCombinators(false);\n    parseOptions.setResolveFully(false);\n    parseOptions.setFlatten(false);\n    return parseOptions;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultComponentsValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.components.*;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.*;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.components.*;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n\n@Component\npublic class DefaultComponentsValidatorFactory implements ComponentsValidatorFactory {\n\n  private HeaderValidatorFactory headerValidatorFactory;\n\n  private ParameterValidatorFactory parameterValidatorFactory;\n\n  private RequestBodyValidatorFactory requestBodyValidatorFactory;\n\n  private ResponseValidatorFactory responseValidatorFactory;\n\n  private SchemaValidatorFactory schemaValidatorFactory;\n\n  private SecuritySchemeValidatorFactory securitySchemeValidatorFactory;\n\n  public DefaultComponentsValidatorFactory(\n      HeaderValidatorFactory headerValidatorFactory,\n      ParameterValidatorFactory parameterValidatorFactory,\n      RequestBodyValidatorFactory requestBodyValidatorFactory,\n      ResponseValidatorFactory responseValidatorFactory,\n      SchemaValidatorFactory schemaValidatorFactory,\n      SecuritySchemeValidatorFactory securitySchemeValidatorFactory) {\n    this.headerValidatorFactory = headerValidatorFactory;\n    this.parameterValidatorFactory = parameterValidatorFactory;\n    this.requestBodyValidatorFactory = requestBodyValidatorFactory;\n    this.responseValidatorFactory = responseValidatorFactory;\n    this.schemaValidatorFactory = schemaValidatorFactory;\n    this.securitySchemeValidatorFactory = securitySchemeValidatorFactory;\n  }\n\n  @Override\n  public List<ComponentsValidator> create(FactoryOptions options) {\n    List<ComponentsValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new ComponentsHeadersValuesValidator(headerValidatorFactory.create(options)));\n    validators.add(new ComponentsParametersValuesValidator(parameterValidatorFactory.create(options)));\n    validators.add(new ComponentsRequestBodiesValuesValidator(requestBodyValidatorFactory.create(options)));\n    validators.add(new ComponentsResponsesValuesValidator(responseValidatorFactory.create(options)));\n    validators.add(new ComponentsSchemasValuesValidator(schemaValidatorFactory.create(options)));\n    validators.add(new ComponentsSecuritySchemesValuesValidator(securitySchemeValidatorFactory.create(options)));\n\n    // concretes\n    addComponentsCallbacksKeysCaseValidator(validators, options);\n    addComponentsExamplesKeysCaseValidator(validators, options);\n    addComponentsHeadersKeysCaseValidator(validators, options);\n    addComponentsLinksKeysCaseValidator(validators, options);\n    addComponentsParametersKeysCaseValidator(validators, options);\n    addComponentsRequestBodiesKeysCaseValidator(validators, options);\n    addComponentsResponsesKeysCaseValidator(validators, options);\n    addComponentsSchemasKeysCaseValidator(validators, options);\n    addComponentsSecuritySchemesKeysCaseValidator(validators, options);\n    return Collections.unmodifiableList(validators);\n  }\n\n  private void addComponentsCallbacksKeysCaseValidator(List<ComponentsValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(ComponentsCallbacksKeysCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ComponentsCallbacksKeysCaseValidator(expectedCase));\n    }\n  }\n\n  private void addComponentsExamplesKeysCaseValidator(List<ComponentsValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(ComponentsExamplesKeysCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ComponentsExamplesKeysCaseValidator(expectedCase));\n    }\n  }\n\n  private void addComponentsHeadersKeysCaseValidator(List<ComponentsValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(ComponentsHeadersKeysCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ComponentsHeadersKeysCaseValidator(expectedCase));\n    }\n  }\n\n  private void addComponentsLinksKeysCaseValidator(List<ComponentsValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(ComponentsLinksKeysCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ComponentsLinksKeysCaseValidator(expectedCase));\n    }\n  }\n\n  private void addComponentsParametersKeysCaseValidator(List<ComponentsValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(ComponentsParametersKeysCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ComponentsParametersKeysCaseValidator(expectedCase));\n    }\n  }\n\n  private void addComponentsRequestBodiesKeysCaseValidator(List<ComponentsValidator> validators,\n      FactoryOptions options) {\n    String expectedCase = options.getString(ComponentsRequestBodiesKeysCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ComponentsRequestBodiesKeysCaseValidator(expectedCase));\n    }\n  }\n\n  private void addComponentsResponsesKeysCaseValidator(List<ComponentsValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(ComponentsResponsesKeysCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ComponentsResponsesKeysCaseValidator(expectedCase));\n    }\n  }\n\n  private void addComponentsSchemasKeysCaseValidator(List<ComponentsValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(ComponentsSchemasKeysCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ComponentsSchemasKeysCaseValidator(expectedCase));\n    }\n  }\n\n  private void addComponentsSecuritySchemesKeysCaseValidator(List<ComponentsValidator> validators,\n      FactoryOptions options) {\n    String expectedCase = options.getString(ComponentsSecuritySchemesKeysCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ComponentsSecuritySchemesKeysCaseValidator(expectedCase));\n    }\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultEncodingValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.encoding.EncodingHeadersKeysCaseValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.EncodingValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.EncodingValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.HeaderValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.encoding.EncodingHeadersValuesValidator;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultEncodingValidatorFactory implements EncodingValidatorFactory {\n\n  private final HeaderValidatorFactory headerValidatorFactory;\n\n  public DefaultEncodingValidatorFactory(\n      HeaderValidatorFactory headerValidatorFactory) {\n    this.headerValidatorFactory = headerValidatorFactory;\n  }\n\n  @Override\n  public List<EncodingValidator> create(FactoryOptions options) {\n\n    List<EncodingValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new EncodingHeadersValuesValidator(headerValidatorFactory.create(options)));\n\n    // concrete\n    addEncodingHeadersKeysCaseValidator(validators, options);\n    return Collections.unmodifiableList(validators);\n  }\n\n  private void addEncodingHeadersKeysCaseValidator(List<EncodingValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(EncodingHeadersKeysCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new EncodingHeadersKeysCaseValidator(expectedCase));\n    }\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultHeaderValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.header.HeaderDescriptionRequiredValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.HeaderValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.HeaderValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.SchemaValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.header.HeaderSchemaValidator;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultHeaderValidatorFactory implements HeaderValidatorFactory {\n\n  private final SchemaValidatorFactory schemaValidatorFactory;\n\n  public DefaultHeaderValidatorFactory(\n      SchemaValidatorFactory schemaValidatorFactory) {\n    this.schemaValidatorFactory = schemaValidatorFactory;\n  }\n\n  @Override\n  public List<HeaderValidator> create(FactoryOptions options) {\n\n    List<HeaderValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new HeaderSchemaValidator(schemaValidatorFactory.create(options)));\n\n    // concretes\n    addHeaderDescriptionRequiredValidator(validators, options);\n    return Collections.unmodifiableList(validators);\n  }\n\n  private void addHeaderDescriptionRequiredValidator(List<HeaderValidator> validators, FactoryOptions options) {\n    Boolean required = options.getBoolean(HeaderDescriptionRequiredValidator.CONFIG_KEY);\n    if (Boolean.TRUE.equals(required)) {\n      validators.add(new HeaderDescriptionRequiredValidator());\n    }\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultInfoValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.info.InfoDescriptionRequiredValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.InfoValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.InfoValidatorFactory;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultInfoValidatorFactory implements InfoValidatorFactory {\n\n  @Override\n  public List<InfoValidator> create(FactoryOptions options) {\n    List<InfoValidator> validators = new ArrayList<>();\n\n    // concretes\n    addInfoDescriptionRequiredValidator(validators, options);\n    return Collections.unmodifiableList(validators);\n  }\n\n  private void addInfoDescriptionRequiredValidator(List<InfoValidator> validators, FactoryOptions options) {\n    Boolean required = options.getBoolean(InfoDescriptionRequiredValidator.CONFIG_KEY);\n    if (Boolean.TRUE.equals(required)) {\n      validators.add(new InfoDescriptionRequiredValidator());\n    }\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultMediaTypeValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MediaTypeValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.EncodingValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.MediaTypeValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.SchemaValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.mediatype.MediaTypeEncodingValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.mediatype.MediaTypeSchemaValidator;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultMediaTypeValidatorFactory implements MediaTypeValidatorFactory {\n\n  private final SchemaValidatorFactory schemaValidatorFactory;\n\n  private final EncodingValidatorFactory encodingValidatorFactory;\n\n  public DefaultMediaTypeValidatorFactory(\n      SchemaValidatorFactory schemaValidatorFactory,\n      EncodingValidatorFactory encodingValidatorFactory) {\n    this.schemaValidatorFactory = schemaValidatorFactory;\n    this.encodingValidatorFactory = encodingValidatorFactory;\n  }\n\n  @Override\n  public List<MediaTypeValidator> create(FactoryOptions options) {\n\n    List<MediaTypeValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new MediaTypeSchemaValidator(schemaValidatorFactory.create(options)));\n    validators.add(new MediaTypeEncodingValidator(encodingValidatorFactory.create(options)));\n\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultOasSpecValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.DefaultOasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.OasSpecValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.OpenApiValidatorFactory;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class DefaultOasSpecValidatorFactory implements OasSpecValidatorFactory {\n\n  private final OpenApiValidatorFactory openApiValidatorFactory;\n\n  public DefaultOasSpecValidatorFactory(\n      OpenApiValidatorFactory openApiValidatorFactory) {\n    this.openApiValidatorFactory = openApiValidatorFactory;\n  }\n\n  @Override\n  public OasSpecValidator create(FactoryOptions options) {\n    return new DefaultOasSpecValidator(openApiValidatorFactory.create(options));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultOpenApiValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.openapi.OpenApiSecuritySizeEqValidator;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.openapi.OpenApiTagsSizeGteValidator;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.openapi.OpenApiVersionGteValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OpenApiValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.*;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.openapi.*;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultOpenApiValidatorFactory implements OpenApiValidatorFactory {\n\n  private final TagValidatorFactory tagValidatorFactory;\n\n  private final InfoValidatorFactory infoValidatorFactory;\n\n  private final PathsValidatorFactory pathsValidatorFactory;\n\n  private final ComponentsValidatorFactory componentsValidatorFactory;\n\n  private final ServerValidatorFactory serverValidatorFactory;\n\n  public DefaultOpenApiValidatorFactory(\n      TagValidatorFactory tagValidatorFactory,\n      InfoValidatorFactory infoValidatorFactory,\n      PathsValidatorFactory pathsValidatorFactory,\n      ComponentsValidatorFactory componentsValidatorFactory,\n      ServerValidatorFactory serverValidatorFactory) {\n    this.tagValidatorFactory = tagValidatorFactory;\n    this.infoValidatorFactory = infoValidatorFactory;\n    this.pathsValidatorFactory = pathsValidatorFactory;\n    this.componentsValidatorFactory = componentsValidatorFactory;\n    this.serverValidatorFactory = serverValidatorFactory;\n  }\n\n  @Override\n  public List<OpenApiValidator> create(FactoryOptions options) {\n\n    List<OpenApiValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new OpenApiTagsValidator(tagValidatorFactory.create(options)));\n    validators.add(new OpenApiInfoValidator(infoValidatorFactory.create(options)));\n    validators.add(new OpenApiPathsValidator(pathsValidatorFactory.create(options)));\n    validators.add(new OpenApiComponentsValidator(componentsValidatorFactory.create(options)));\n    validators.add(new OpenApiServersValidator(serverValidatorFactory.create(options)));\n\n    // concretes\n    addOpenApiSecuritySizeValidator(validators, options);\n    addOpenApiTagsSizeValidator(validators, options);\n    addOpenApiVersionGteValidator(validators, options);\n\n    return Collections.unmodifiableList(validators);\n  }\n\n  private void addOpenApiSecuritySizeValidator(List<OpenApiValidator> validators, FactoryOptions options) {\n    Integer size = options.getInteger(OpenApiSecuritySizeEqValidator.CONFIG_KEY);\n    if (size != null) {\n      validators.add(new OpenApiSecuritySizeEqValidator(size));\n    }\n  }\n\n  private void addOpenApiTagsSizeValidator(List<OpenApiValidator> validators, FactoryOptions options) {\n    Integer size = options.getInteger(OpenApiTagsSizeGteValidator.CONFIG_KEY);\n    if (size != null) {\n      validators.add(new OpenApiTagsSizeGteValidator(size));\n    }\n  }\n\n  private void addOpenApiVersionGteValidator(List<OpenApiValidator> validators, FactoryOptions options) {\n    String versionGte = options.getString(OpenApiVersionGteValidator.CONFIG_KEY);\n    if (versionGte != null) {\n      validators.add(new OpenApiVersionGteValidator(versionGte));\n    }\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultOperationValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.operation.*;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OperationValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.OperationValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.ParameterValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.RequestBodyValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.ResponsesValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.operation.OperationParametersValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.operation.OperationRequestBodyValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.operation.OperationResponsesValidator;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultOperationValidatorFactory implements OperationValidatorFactory {\n\n\n  private final ParameterValidatorFactory parameterValidatorFactory;\n\n  private final ResponsesValidatorFactory responsesValidatorFactory;\n\n  private final RequestBodyValidatorFactory requestBodyValidatorFactory;\n\n  public DefaultOperationValidatorFactory(\n      ParameterValidatorFactory parameterValidatorFactory,\n      ResponsesValidatorFactory responsesValidatorFactory,\n      RequestBodyValidatorFactory requestBodyValidatorFactory) {\n    this.parameterValidatorFactory = parameterValidatorFactory;\n    this.responsesValidatorFactory = responsesValidatorFactory;\n    this.requestBodyValidatorFactory = requestBodyValidatorFactory;\n  }\n\n  @Override\n  public List<OperationValidator> create(FactoryOptions options) {\n\n    List<OperationValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new OperationParametersValidator(parameterValidatorFactory.create(options)));\n    validators.add(new OperationResponsesValidator(responsesValidatorFactory.create(options)));\n    validators.add(new OperationRequestBodyValidator(requestBodyValidatorFactory.create(options)));\n\n    // concretes\n    addOperationSummaryRequiredValidator(validators, options);\n    addOperationIdCaseValidator(validators, options);\n    addOperationTagsSizeEqValidator(validators, options);\n    addOperationServersSizeEqValidator(validators, options);\n    addOperationTagsReferenceValidator(validators, options);\n\n    return Collections.unmodifiableList(validators);\n  }\n\n  private void addOperationSummaryRequiredValidator(List<OperationValidator> validators, FactoryOptions options) {\n    Boolean required = options.getBoolean(OperationSummaryRequiredValidator.CONFIG_KEY);\n    if (Boolean.TRUE.equals(required)) {\n      validators.add(new OperationSummaryRequiredValidator());\n    }\n  }\n\n  private void addOperationIdCaseValidator(List<OperationValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(OperationIdCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new OperationIdCaseValidator(expectedCase));\n    }\n  }\n\n  private void addOperationTagsSizeEqValidator(List<OperationValidator> validators, FactoryOptions options) {\n    Integer expectedSize = options.getInteger(OperationTagsSizeEqValidator.CONFIG_KEY);\n    if (expectedSize != null) {\n      validators.add(new OperationTagsSizeEqValidator(expectedSize));\n    }\n  }\n\n  private void addOperationServersSizeEqValidator(List<OperationValidator> validators, FactoryOptions options) {\n    Integer expectedSize = options.getInteger(OperationServersSizeEqValidator.CONFIG_KEY);\n    if (expectedSize != null) {\n      validators.add(new OperationServersSizeEqValidator(expectedSize));\n    }\n  }\n\n  private void addOperationTagsReferenceValidator(List<OperationValidator> validators, FactoryOptions options) {\n    Boolean needCheck = options.getBoolean(OperationTagsReferenceValidator.CONFIG_KEY);\n    if (Boolean.TRUE.equals(needCheck)) {\n      validators.add(new OperationTagsReferenceValidator());\n    }\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultParameterValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.parameter.*;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.MediaTypeValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.ParameterValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.SchemaValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.parameter.ParameterContentValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.parameter.ParameterSchemaValidator;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultParameterValidatorFactory implements ParameterValidatorFactory {\n\n  private final SchemaValidatorFactory schemaValidatorFactory;\n\n  private final MediaTypeValidatorFactory mediaTypeValidatorFactory;\n\n  public DefaultParameterValidatorFactory(\n      SchemaValidatorFactory schemaValidatorFactory,\n      MediaTypeValidatorFactory mediaTypeValidatorFactory) {\n    this.schemaValidatorFactory = schemaValidatorFactory;\n    this.mediaTypeValidatorFactory = mediaTypeValidatorFactory;\n  }\n\n  @Override\n  public List<ParameterValidator> create(FactoryOptions options) {\n\n    List<ParameterValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new ParameterSchemaValidator(schemaValidatorFactory.create(options)));\n    validators.add(new ParameterContentValidator(mediaTypeValidatorFactory.create(options)));\n\n    // concretes\n    addParameterNameCookieCaseValidator(validators, options);\n    addParameterNameHeaderCaseValidator(validators, options);\n    addParameterNamePathCaseValidator(validators, options);\n    addParameterNameQueryCaseValidator(validators, options);\n    addParameterDescriptionRequiredValidator(validators, options);\n\n    return Collections.unmodifiableList(validators);\n  }\n\n  private void addParameterNameCookieCaseValidator(List<ParameterValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(ParameterNameCookieCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ParameterNameCookieCaseValidator(expectedCase));\n    }\n  }\n\n  private void addParameterNameHeaderCaseValidator(List<ParameterValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(ParameterNameHeaderCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ParameterNameHeaderCaseValidator(expectedCase));\n    }\n  }\n\n  private void addParameterNamePathCaseValidator(List<ParameterValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(ParameterNamePathCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ParameterNamePathCaseValidator(expectedCase));\n    }\n  }\n\n  private void addParameterNameQueryCaseValidator(List<ParameterValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(ParameterNameQueryCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ParameterNameQueryCaseValidator(expectedCase));\n    }\n  }\n\n  private void addParameterDescriptionRequiredValidator(List<ParameterValidator> validators, FactoryOptions options) {\n    Boolean required = options.getBoolean(ParameterDescriptionRequiredValidator.CONFIG_KEY);\n    if (Boolean.TRUE.equals(required)) {\n      validators.add(new ParameterDescriptionRequiredValidator());\n    }\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultPathItemValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.PathItemValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.OperationValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.ParameterValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.PathItemValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.pathitem.PathItemOperationsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.pathitem.PathItemParametersValidator;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultPathItemValidatorFactory implements PathItemValidatorFactory {\n\n  private final OperationValidatorFactory operationValidatorFactory;\n\n  private final ParameterValidatorFactory parameterValidatorFactory;\n\n  public DefaultPathItemValidatorFactory(\n      OperationValidatorFactory operationValidatorFactory,\n      ParameterValidatorFactory parameterValidatorFactory) {\n    this.operationValidatorFactory = operationValidatorFactory;\n    this.parameterValidatorFactory = parameterValidatorFactory;\n  }\n\n  @Override\n  public List<PathItemValidator> create(FactoryOptions options) {\n    ArrayList<PathItemValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new PathItemOperationsValidator(operationValidatorFactory.create(options)));\n    validators.add(new PathItemParametersValidator(parameterValidatorFactory.create(options)));\n\n    return Collections.unmodifiableList(validators);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultPathsValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.paths.PathsKeyCaseValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.PathsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.PathItemValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.PathsValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.paths.PathsPathItemsValidator;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultPathsValidatorFactory implements PathsValidatorFactory {\n\n  private final PathItemValidatorFactory pathItemValidatorFactory;\n\n  public DefaultPathsValidatorFactory(\n      PathItemValidatorFactory pathItemValidatorFactory) {\n    this.pathItemValidatorFactory = pathItemValidatorFactory;\n  }\n\n  @Override\n  public List<PathsValidator> create(FactoryOptions options) {\n    List<PathsValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new PathsPathItemsValidator(pathItemValidatorFactory.create(options)));\n\n    // concretes\n    addPathsKeyCaseValidator(validators, options);\n    return Collections.unmodifiableList(validators);\n  }\n\n  private void addPathsKeyCaseValidator(List<PathsValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(PathsKeyCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new PathsKeyCaseValidator(expectedCase));\n    }\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultRequestBodyValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.requestbody.RequestBodyDescriptionRequiredValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.RequestBodyValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.MediaTypeValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.RequestBodyValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.requestbody.RequestBodyContentValidator;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultRequestBodyValidatorFactory implements RequestBodyValidatorFactory {\n\n  private final MediaTypeValidatorFactory mediaTypeValidatorFactory;\n\n  public DefaultRequestBodyValidatorFactory(\n      MediaTypeValidatorFactory mediaTypeValidatorFactory) {\n    this.mediaTypeValidatorFactory = mediaTypeValidatorFactory;\n  }\n\n  @Override\n  public List<RequestBodyValidator> create(FactoryOptions options) {\n\n    List<RequestBodyValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new RequestBodyContentValidator(mediaTypeValidatorFactory.create(options)));\n\n    // concretes\n    addRequestBodyDescriptionRequiredValidator(validators, options);\n    return Collections.unmodifiableList(validators);\n  }\n\n  private void addRequestBodyDescriptionRequiredValidator(List<RequestBodyValidator> validators,\n      FactoryOptions options) {\n    Boolean required = options.getBoolean(RequestBodyDescriptionRequiredValidator.CONFIG_KEY);\n    if (Boolean.TRUE.equals(required)) {\n      validators.add(new RequestBodyDescriptionRequiredValidator());\n    }\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultResponseValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.response.ResponseHeadersKeysCaseValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.HeaderValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.MediaTypeValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.ResponseValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.response.ResponseContentValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.response.ResponseHeadersValuesValidator;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultResponseValidatorFactory implements ResponseValidatorFactory {\n\n  private final MediaTypeValidatorFactory mediaTypeValidatorFactory;\n\n  private final HeaderValidatorFactory headerValidatorFactory;\n\n  public DefaultResponseValidatorFactory(\n      MediaTypeValidatorFactory mediaTypeValidatorFactory,\n      HeaderValidatorFactory headerValidatorFactory) {\n    this.mediaTypeValidatorFactory = mediaTypeValidatorFactory;\n    this.headerValidatorFactory = headerValidatorFactory;\n  }\n\n  @Override\n  public List<ResponseValidator> create(FactoryOptions options) {\n\n    List<ResponseValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new ResponseContentValidator(mediaTypeValidatorFactory.create(options)));\n    validators.add(new ResponseHeadersValuesValidator(headerValidatorFactory.create(options)));\n\n    // concretes\n    addResponseHeadersKeysCaseValidator(validators, options);\n    return Collections.unmodifiableList(validators);\n  }\n\n  private void addResponseHeadersKeysCaseValidator(List<ResponseValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(ResponseHeadersKeysCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new ResponseHeadersKeysCaseValidator(expectedCase));\n    }\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultResponsesValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ResponsesValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.ResponseValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.ResponsesValidatorFactory;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.responses.ResponsesResponsesValidator;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultResponsesValidatorFactory implements ResponsesValidatorFactory {\n\n  private final ResponseValidatorFactory responseValidatorFactory;\n\n  public DefaultResponsesValidatorFactory(\n      ResponseValidatorFactory responseValidatorFactory) {\n    this.responseValidatorFactory = responseValidatorFactory;\n  }\n\n  @Override\n  public List<ResponsesValidator> create(FactoryOptions options) {\n\n    List<ResponsesValidator> validators = new ArrayList<>();\n\n    // skeletons\n    validators.add(new ResponsesResponsesValidator(responseValidatorFactory.create(options)));\n\n    return Collections.unmodifiableList(validators);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultSchemaValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.schema.SchemaPropertiesKeysCaseValidator;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.schema.SchemaTitleRequiredValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.SchemaValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.SchemaValidatorFactory;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultSchemaValidatorFactory implements SchemaValidatorFactory {\n\n  @Override\n  public List<SchemaValidator> create(FactoryOptions options) {\n    ArrayList<SchemaValidator> validators = new ArrayList<>();\n\n    // concretes\n    addSchemaTitleRequiredValidator(validators, options);\n    addSchemaPropertiesKeysCaseValidator(validators, options);\n    return Collections.unmodifiableList(validators);\n  }\n\n  private void addSchemaTitleRequiredValidator(List<SchemaValidator> validators, FactoryOptions options) {\n    Boolean required = options.getBoolean(SchemaTitleRequiredValidator.CONFIG_KEY);\n    if (Boolean.TRUE.equals(required)) {\n      validators.add(new SchemaTitleRequiredValidator());\n    }\n  }\n\n  private void addSchemaPropertiesKeysCaseValidator(List<SchemaValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(SchemaPropertiesKeysCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new SchemaPropertiesKeysCaseValidator(expectedCase));\n    }\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultSecuritySchemeValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.SecuritySchemeValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.SecuritySchemeValidatorFactory;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultSecuritySchemeValidatorFactory implements SecuritySchemeValidatorFactory {\n\n  @Override\n  public List<SecuritySchemeValidator> create(FactoryOptions options) {\n    return Collections.emptyList();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultServerValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ServerValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.ServerValidatorFactory;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultServerValidatorFactory implements ServerValidatorFactory {\n\n  @Override\n  public List<ServerValidator> create(FactoryOptions options) {\n    return Collections.emptyList();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultTagValidatorFactory.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.tag.TagDescriptionRequiredValidator;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.tag.TagMustBeReferencedValidator;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.tag.TagNameCaseValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.TagValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.TagValidatorFactory;\nimport org.springframework.stereotype.Component;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\n@Component\npublic class DefaultTagValidatorFactory implements TagValidatorFactory {\n\n  @Override\n  public List<TagValidator> create(FactoryOptions options) {\n    List<TagValidator> validators = new ArrayList<>();\n\n    // concretes\n    addTagDescriptionRequiredValidator(validators, options);\n    addTagMustBeReferencedValidator(validators, options);\n    addTagNameCaseValidator(validators, options);\n\n    return Collections.unmodifiableList(validators);\n  }\n\n  private void addTagDescriptionRequiredValidator(List<TagValidator> validators, FactoryOptions options) {\n    Boolean required = options.getBoolean(TagDescriptionRequiredValidator.CONFIG_KEY);\n    if (Boolean.TRUE.equals(required)) {\n      validators.add(new TagDescriptionRequiredValidator());\n    }\n  }\n\n  private void addTagMustBeReferencedValidator(List<TagValidator> validators, FactoryOptions options) {\n    Boolean required = options.getBoolean(TagMustBeReferencedValidator.CONFIG_KEY);\n    if (Boolean.TRUE.equals(required)) {\n      validators.add(new TagMustBeReferencedValidator());\n    }\n  }\n\n  private void addTagNameCaseValidator(List<TagValidator> validators, FactoryOptions options) {\n    String expectedCase = options.getString(TagNameCaseValidator.CONFIG_KEY);\n    if (expectedCase != null) {\n      validators.add(new TagNameCaseValidator(expectedCase));\n    }\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/factory/ValidatorFactoryComponents.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.springframework.context.annotation.ComponentScan;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\n@ComponentScan\npublic interface ValidatorFactoryComponents {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsCallbacksKeysCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.components.ComponentsCallbacksKeysValidator;\n\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a>\n * .callbacks property key case validator\n * <ul>\n *   <li>config item: components.callbacks.key.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class ComponentsCallbacksKeysCaseValidator extends ComponentsCallbacksKeysValidator {\n\n  public static final String CONFIG_KEY = \"components.callbacks.key.case\";\n  public static final String ERROR = \"Must be \";\n\n  public ComponentsCallbacksKeysCaseValidator(String expectedCase) {\n    super(\n        key -> isMatchCase(expectedCase, key),\n        key -> ERROR + expectedCase\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsExamplesKeysCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.components.ComponentsExamplesKeysValidator;\n\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a>\n * .examples property key case validator\n * <ul>\n *   <li>config item: components.examples.key.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class ComponentsExamplesKeysCaseValidator extends ComponentsExamplesKeysValidator {\n\n  public static final String CONFIG_KEY = \"components.examples.key.case\";\n  public static final String ERROR = \"Must be \";\n\n  public ComponentsExamplesKeysCaseValidator(String expectedCase) {\n    super(\n        key -> isMatchCase(expectedCase, key),\n        key -> ERROR + expectedCase\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsHeadersKeysCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.components.ComponentsHeadersKeysValidator;\n\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a>\n * .headers property key case validator\n * <ul>\n *   <li>config item: components.headers.key.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class ComponentsHeadersKeysCaseValidator extends ComponentsHeadersKeysValidator {\n\n  public static final String CONFIG_KEY = \"components.headers.key.case\";\n  public static final String ERROR = \"Must be \";\n\n  public ComponentsHeadersKeysCaseValidator(String expectedCase) {\n    super(\n        key -> isMatchCase(expectedCase, key),\n        key -> ERROR + expectedCase\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsLinksKeysCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.components.ComponentsLinksKeysValidator;\n\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a>\n * .links property key case validator\n * <ul>\n *   <li>config item: components.links.key.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class ComponentsLinksKeysCaseValidator extends ComponentsLinksKeysValidator {\n\n  public static final String CONFIG_KEY = \"components.links.key.case\";\n  public static final String ERROR = \"Must be \";\n\n  public ComponentsLinksKeysCaseValidator(String expectedCase) {\n    super(\n        key -> isMatchCase(expectedCase, key),\n        key -> ERROR + expectedCase\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsParametersKeysCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.components.ComponentsParametersKeysValidator;\n\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a>\n * .parameters property key case validator\n * <ul>\n *   <li>config item: components.parameters.key.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class ComponentsParametersKeysCaseValidator extends ComponentsParametersKeysValidator {\n\n  public static final String CONFIG_KEY = \"components.parameters.key.case\";\n  public static final String ERROR = \"Must be \";\n\n  public ComponentsParametersKeysCaseValidator(String expectedCase) {\n    super(\n        key -> isMatchCase(expectedCase, key),\n        key -> ERROR + expectedCase\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsRequestBodiesKeysCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.components.ComponentsRequestBodiesKeysValidator;\n\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a>\n * .requestBodies property key case validator\n * <ul>\n *   <li>config item: components.requestBodies.key.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class ComponentsRequestBodiesKeysCaseValidator extends ComponentsRequestBodiesKeysValidator {\n\n  public static final String CONFIG_KEY = \"components.requestBodies.key.case\";\n  public static final String ERROR = \"Must be \";\n\n  public ComponentsRequestBodiesKeysCaseValidator(String expectedCase) {\n    super(\n        key -> isMatchCase(expectedCase, key),\n        key -> ERROR + expectedCase\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsResponsesKeysCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.components.ComponentsResponsesKeysValidator;\n\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a>\n * .responses property key case validator\n * <ul>\n *   <li>config item: components.responses.key.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class ComponentsResponsesKeysCaseValidator extends ComponentsResponsesKeysValidator {\n\n  public static final String CONFIG_KEY = \"components.responses.key.case\";\n  public static final String ERROR = \"Must be \";\n\n  public ComponentsResponsesKeysCaseValidator(String expectedCase) {\n    super(\n        key -> isMatchCase(expectedCase, key),\n        key -> ERROR + expectedCase\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsSchemasKeysCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.components.ComponentsSchemasKeysValidator;\n\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a>\n * .schemas property key case validator\n * <ul>\n *   <li>config item: components.schemas.key.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class ComponentsSchemasKeysCaseValidator extends ComponentsSchemasKeysValidator {\n\n  public static final String CONFIG_KEY = \"components.schemas.key.case\";\n  public static final String ERROR = \"Must be \";\n\n  public ComponentsSchemasKeysCaseValidator(String expectedCase) {\n    super(\n        key -> isMatchCase(expectedCase, key),\n        key -> ERROR + expectedCase\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsSecuritySchemesKeysCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.components.ComponentsSecuritySchemesKeysValidator;\n\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a>\n * .securitySchemes property key case validator\n * <ul>\n *   <li>config item: components.securitySchemes.key.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class ComponentsSecuritySchemesKeysCaseValidator extends ComponentsSecuritySchemesKeysValidator {\n\n  public static final String CONFIG_KEY = \"components.securitySchemes.key.case\";\n  public static final String ERROR = \"Must be \";\n\n  public ComponentsSecuritySchemesKeysCaseValidator(String expectedCase) {\n    super(\n        key -> isMatchCase(expectedCase, key),\n        key -> ERROR + expectedCase\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/encoding/EncodingHeadersKeysCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.encoding;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.encoding.EncodingHeadersKeysValidator;\n\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#encodingObject\">Encoding Object</a>\n * .headers property key case validator\n * <ul>\n *   <li>config item: encoding.headers.key.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class EncodingHeadersKeysCaseValidator extends EncodingHeadersKeysValidator {\n\n  public static final String CONFIG_KEY = \"encoding.headers.key.case\";\n  public static final String ERROR = \"Must be \";\n\n  public EncodingHeadersKeysCaseValidator(String expectedCase) {\n    super(\n        key -> isMatchCase(expectedCase, key),\n        key -> ERROR + expectedCase\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/header/HeaderDescriptionRequiredValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.header;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.api.HeaderValidator;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyRequiredValidator;\nimport io.swagger.v3.oas.models.headers.Header;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#headerObject\">Header Object</a>\n * .description property validator\n * <ul>\n *   <li>config item: header.description.required=*boolean*</li>\n *   <li>description must not be null</li>\n * </ul>\n */\npublic class HeaderDescriptionRequiredValidator\n  extends ObjectPropertyRequiredValidator<Header, String>\n  implements HeaderValidator {\n\n  public static final String CONFIG_KEY = \"header.description.required\";\n\n\n  @Override\n  protected String get$ref(Header oasObject) {\n    return oasObject.get$ref();\n  }\n\n  @Override\n  protected String getPropertyObject(Header oasObject) {\n    return oasObject.getDescription();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"description\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return null;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/info/InfoDescriptionRequiredValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.info;\n\nimport io.swagger.v3.oas.models.info.Info;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.InfoValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyRequiredValidator;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#infoObject\">Info Object</a>\n * description property validator\n * <ul>\n *   <li>config item: info.description.required=*boolean*</li>\n *   <li>description must not be null</li>\n * </ul>\n */\npublic class InfoDescriptionRequiredValidator\n  extends ObjectPropertyRequiredValidator<Info, String>\n  implements InfoValidator {\n\n  public static final String CONFIG_KEY = \"info.description.required\";\n\n  @Override\n  protected String get$ref(Info oasObject) {\n    return null;\n  }\n\n  @Override\n  protected String getPropertyObject(Info oasObject) {\n    return oasObject.getDescription();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"description\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return null;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/openapi/OpenApiSecuritySizeEqValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.openapi;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.commons.collections4.CollectionUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OpenApiValidator;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SECURITY_REQUIREMENT;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#openapi-object\">OpenAPI Object</a>\n * .security property validator\n * <ul>\n * <li>config item: openAPI.security.size.eq=expected</li>\n * <li>size should be equals to *expected*</li>\n * </ul>\n */\npublic class OpenApiSecuritySizeEqValidator implements OpenApiValidator {\n\n  public static final String CONFIG_KEY = \"openAPI.security.size.eq\";\n  public static final String ERROR = \"size must be == \";\n\n  private final int expectedSize;\n\n  public OpenApiSecuritySizeEqValidator(int expectedSize) {\n    this.expectedSize = expectedSize;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    OpenAPI openAPI) {\n\n    int size = CollectionUtils.size(openAPI.getSecurity());\n    if (size != expectedSize) {\n      return singletonList(\n          new OasViolation(location.property(\"security\", SECURITY_REQUIREMENT), ERROR + expectedSize));\n    }\n\n    return emptyList();\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/openapi/OpenApiTagsSizeGteValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.openapi;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.commons.collections4.CollectionUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OpenApiValidator;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#openapi-object\">OpenAPI Object</a>\n * .tags(List of <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#tagObject\">Tag Object</a>)\n * size validator\n * <ul>\n *   <li>config item: openAPI.tags.size.gte=expected</li>\n *   <li>size should be &gt;= *expected*</li>\n * </ul>\n */\npublic class OpenApiTagsSizeGteValidator implements OpenApiValidator {\n\n  public static final String CONFIG_KEY = \"openAPI.tags.size.gte\";\n  public static final String ERROR = \"size must be >= \";\n\n  private final int expectedSize;\n\n  public OpenApiTagsSizeGteValidator(int expectedSize) {\n    this.expectedSize = expectedSize;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location, OpenAPI openAPI) {\n\n    if (CollectionUtils.size(openAPI.getTags()) < expectedSize) {\n      return singletonList(new OasViolation(location.property(\"tags\", OasObjectType.TAG), ERROR + expectedSize));\n    }\n    return emptyList();\n\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/openapi/OpenApiVersionGteValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.openapi;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.*;\nimport io.swagger.v3.oas.models.OpenAPI;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#openapi-object\">OpenAPI Object</a>\n * .openapi property validator\n <ul>\n *   <li>config item: openAPI.openapi.gte=expected</li>\n *   <li>version should be &gt;= *expected*</li>\n * </ul>\n */\npublic class OpenApiVersionGteValidator implements OpenApiValidator {\n\n  public static final String CONFIG_KEY = \"openAPI.openapi.gte\";\n  public static final String ERROR = \"Must be >= \";\n\n  private final String versionGte;\n\n  public OpenApiVersionGteValidator(String versionGte) {\n    this.versionGte = versionGte;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location, OpenAPI openAPI) {\n\n    if (openAPI.getOpenapi() == null) {\n      return singletonList(new OasViolation(location.property(\"openapi\"), ViolationMessages.REQUIRED));\n    }\n\n    String[] semver = openAPI.getOpenapi().split(\"\\\\.\");\n    String[] expectedSemver = versionGte.split(\"\\\\.\");\n    boolean ok = semver[0].equals(expectedSemver[0])\n        && semver[1].equals(expectedSemver[1])\n        && Integer.parseInt(semver[2]) >= Integer.valueOf(expectedSemver[2]);\n    if (ok) {\n      return emptyList();\n    }\n    return singletonList(new OasViolation(location.property(\"openapi\"), ERROR + versionGte));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/operation/OperationIdCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.operation;\n\nimport io.swagger.v3.oas.models.Operation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OperationValidator;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\">Operation Object</a>\n * .operationId case validator\n * <ul>\n *   <li>config item: operation.operationId.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class OperationIdCaseValidator implements OperationValidator {\n\n  public static final String CONFIG_KEY = \"operation.operationId.case\";\n  public static final String ERROR = \"Must be \";\n\n  private final String expectedCase;\n\n  public OperationIdCaseValidator(String expectedCase) {\n    this.expectedCase = expectedCase;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    Operation oasObject) {\n\n    if (!isMatchCase(expectedCase, oasObject.getOperationId())) {\n      return singletonList(new OasViolation(location.property(\"operationId\"), ERROR + expectedCase));\n    }\n    return emptyList();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/operation/OperationServersSizeEqValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.operation;\n\nimport io.swagger.v3.oas.models.Operation;\nimport org.apache.commons.collections4.CollectionUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OperationValidator;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SERVER;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\">Operation Object</a>\n * .servers size validator\n * <ul>\n *   <li>config item: operations.servers.size.eq=*expected*</li>\n *   <li>size should be equals to *expected*</li>\n * </ul>\n */\npublic class OperationServersSizeEqValidator implements OperationValidator {\n\n  public static final String CONFIG_KEY = \"operations.servers.size.eq\";\n  public static final String ERROR = \"size must be == \";\n\n  private final int expectedSize;\n\n  public OperationServersSizeEqValidator(int expectedSize) {\n    this.expectedSize = expectedSize;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    Operation oasObject) {\n\n    if (CollectionUtils.size(oasObject.getServers()) != expectedSize) {\n      return singletonList(new OasViolation(location.property(\"servers\", SERVER), ERROR + expectedSize));\n    }\n    return emptyList();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/operation/OperationSummaryRequiredValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.operation;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OperationValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyRequiredValidator;\nimport io.swagger.v3.oas.models.Operation;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\">Operation Object</a>\n * .summary required validator\n * <ul>\n *   <li>config item: operation.summary.required=*boolean*</li>\n *   <li>this field is required</li>\n * </ul>\n */\npublic class OperationSummaryRequiredValidator\n  extends ObjectPropertyRequiredValidator<Operation, String>\n  implements OperationValidator {\n\n  public static final String CONFIG_KEY = \"operation.summary.required\";\n\n  @Override\n  protected String get$ref(Operation oasObject) {\n    return null;\n  }\n\n  @Override\n  protected String getPropertyObject(Operation oasObject) {\n    return oasObject.getSummary();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"summary\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return null;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/operation/OperationTagsReferenceValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.operation;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.Operation;\nimport io.swagger.v3.oas.models.tags.Tag;\nimport org.apache.commons.collections4.CollectionUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OperationValidator;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Set;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.emptySet;\nimport static java.util.stream.Collectors.toSet;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\">Operation Object</a>\n * .tags must reference root tags validator\n * <ul>\n * <li>config item: operation.tags.element.must_reference_root_tags=*boolean*</li>\n * <li>must reference tags defined in OpenAPI Object tags property</li>\n * </ul>\n */\npublic class OperationTagsReferenceValidator implements OperationValidator {\n\n  public static final String CONFIG_KEY = \"operation.tags.element.must_reference_root_tags\";\n\n  public static final String ERROR = \"is not defined in $.tags\";\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    Operation oasObject) {\n\n    List<String> tags = oasObject.getTags();\n    if (CollectionUtils.isEmpty(tags)) {\n      return emptyList();\n    }\n\n    List<OasViolation> violations = new ArrayList<>();\n\n    Set<String> globalTagNames = getGlobalTagNames(context.getOpenAPI());\n    for (int i = 0; i < tags.size(); i++) {\n      String tagName = tags.get(i);\n      if (!globalTagNames.contains(tagName)) {\n        violations.add(\n          new OasViolation(location.property(\"tags[\" + i + \"]\"), ERROR));\n      }\n    }\n\n    return violations;\n  }\n\n  public Set<String> getGlobalTagNames(OpenAPI openAPI) {\n    if (CollectionUtils.isEmpty(openAPI.getTags())) {\n      return emptySet();\n    }\n    return openAPI.getTags().stream().map(Tag::getName).collect(toSet());\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/operation/OperationTagsSizeEqValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.operation;\n\nimport io.swagger.v3.oas.models.Operation;\nimport org.apache.commons.collections4.CollectionUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OperationValidator;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\">Operation Object</a>\n * .tags size validator\n * <ul>\n *   <li>config item: operation.tags.size.eq=*expected*</li>\n *   <li>size should be equals to *expected*</li>\n * </ul>\n */\npublic class OperationTagsSizeEqValidator implements OperationValidator {\n\n  public static final String CONFIG_KEY = \"operation.tags.size.eq\";\n  public static final String ERROR = \"size must be == \";\n\n  private final int expectedSize;\n\n  public OperationTagsSizeEqValidator(int expectedSize) {\n    this.expectedSize = expectedSize;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    Operation oasObject) {\n\n    List<String> tags = oasObject.getTags();\n    if (CollectionUtils.size(tags) != expectedSize) {\n      return singletonList(new OasViolation(location.property(\"tags\"), ERROR + expectedSize));\n    }\n    return emptyList();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/ParameterDescriptionRequiredValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.parameter;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyRequiredValidator;\nimport io.swagger.v3.oas.models.parameters.Parameter;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject\">Parameter Object</a>\n * .description property validator\n * <ul>\n * <li>config item: parameter.description.required=*boolean*</li>\n * <li>this field is required</li>\n * </ul>\n */\npublic class ParameterDescriptionRequiredValidator\n  extends ObjectPropertyRequiredValidator<Parameter, String>\n  implements ParameterValidator {\n\n  public static final String CONFIG_KEY = \"parameter.description.required\";\n\n  @Override\n  protected String get$ref(Parameter oasObject) {\n    return oasObject.get$ref();\n  }\n\n  @Override\n  protected String getPropertyObject(Parameter oasObject) {\n    return oasObject.getDescription();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"description\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return null;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/ParameterNameCookieCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.parameter;\n\nimport io.swagger.v3.oas.models.parameters.Parameter;\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject\">Parameter Object</a>\n * .name case validator for cookie\n * <ul>\n * <li>config item: parameter.name.cookie.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n * <li>must match case</li>\n * </ul>\n */\npublic class ParameterNameCookieCaseValidator implements ParameterValidator {\n\n  public static final String CONFIG_KEY = \"parameter.name.cookie.case\";\n  public static final String ERROR = \"Must be \";\n\n  private final String expectedCase;\n\n  public ParameterNameCookieCaseValidator(String expectedCase) {\n    this.expectedCase = expectedCase;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    Parameter oasObject) {\n\n    if (StringUtils.isNotBlank(oasObject.get$ref())) {\n      return emptyList();\n    }\n\n    if (!\"cookie\".equalsIgnoreCase(oasObject.getIn())) {\n      return emptyList();\n    }\n\n    if (!isMatchCase(expectedCase, oasObject.getName())) {\n      return singletonList(new OasViolation(location.property(\"name\"), ERROR + expectedCase));\n    }\n    return emptyList();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/ParameterNameHeaderCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.parameter;\n\nimport io.swagger.v3.oas.models.parameters.Parameter;\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject\">Parameter Object</a>\n * .name case validator for header\n * <ul>\n * <li>config item: parameter.name.header.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n * <li>must match case</li>\n * </ul>\n */\npublic class ParameterNameHeaderCaseValidator implements ParameterValidator {\n\n  public static final String CONFIG_KEY = \"parameter.name.header.case\";\n  public static final String ERROR = \"Must be \";\n\n  private final String expectedCase;\n\n  public ParameterNameHeaderCaseValidator(String expectedCase) {\n    this.expectedCase = expectedCase;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    Parameter oasObject) {\n\n    if (StringUtils.isNotBlank(oasObject.get$ref())) {\n      return emptyList();\n    }\n\n    if (!\"header\".equalsIgnoreCase(oasObject.getIn())) {\n      return emptyList();\n    }\n\n    if (!isMatchCase(expectedCase, oasObject.getName())) {\n      return singletonList(new OasViolation(location.property(\"name\"), ERROR + expectedCase));\n    }\n\n    return emptyList();\n\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/ParameterNamePathCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.parameter;\n\nimport io.swagger.v3.oas.models.parameters.Parameter;\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject\">Parameter Object</a>\n * .name case validator for path\n * <ul>\n * <li>config item: parameter.name.path.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n * <li>must match case</li>\n * </ul>\n */\npublic class ParameterNamePathCaseValidator implements ParameterValidator {\n\n  public static final String CONFIG_KEY = \"parameter.name.path.case\";\n  public static final String ERROR = \"Must be \";\n\n  private final String expectedCase;\n\n  public ParameterNamePathCaseValidator(String expectedCase) {\n    this.expectedCase = expectedCase;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    Parameter oasObject) {\n\n    if (StringUtils.isNotBlank(oasObject.get$ref())) {\n      return emptyList();\n    }\n\n    if (!\"path\".equalsIgnoreCase(oasObject.getIn())) {\n      return emptyList();\n    }\n\n    if (!isMatchCase(expectedCase, oasObject.getName())) {\n      return singletonList(new OasViolation(location.property(\"name\"), ERROR + expectedCase));\n    }\n\n    return emptyList();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/ParameterNameQueryCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.parameter;\n\nimport io.swagger.v3.oas.models.parameters.Parameter;\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject\">Parameter Object</a>\n * .name case validator for query\n * <ul>\n * <li>config item: parameter.name.query.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n * <li>must match case</li>\n * </ul>\n */\npublic class ParameterNameQueryCaseValidator implements ParameterValidator {\n\n  public static final String CONFIG_KEY = \"parameter.name.query.case\";\n  public static final String ERROR = \"Must be \";\n\n  private final String expectedCase;\n\n  public ParameterNameQueryCaseValidator(String expectedCase) {\n    this.expectedCase = expectedCase;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location,\n    Parameter oasObject) {\n\n    if (StringUtils.isNotBlank(oasObject.get$ref())) {\n      return emptyList();\n    }\n\n    if (!\"query\".equalsIgnoreCase(oasObject.getIn())) {\n      return emptyList();\n    }\n\n    if (!isMatchCase(expectedCase, oasObject.getName())) {\n      return singletonList(new OasViolation(location.property(\"name\"), ERROR + expectedCase));\n    }\n\n    return emptyList();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/paths/PathsKeyCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.paths;\n\nimport io.swagger.v3.oas.models.Paths;\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.PathsValidator;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Set;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathsObject\">Paths Object</a>\n * key case validator\n * <ul>\n *   <li>config item: paths.key.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n * <p>\n *   <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#path-templating\">Path Templating</a>\n *   variable must also match case\n * </p>\n */\npublic class PathsKeyCaseValidator implements PathsValidator {\n\n  public static final String CONFIG_KEY = \"paths.key.case\";\n  public static final String ERROR = \"Must be \";\n\n  private static final Pattern TEMPLATE_PATTERN = Pattern.compile(\"^\\\\{(.*)\\\\}$\");\n\n  private final String expectedCase;\n\n\n  public PathsKeyCaseValidator(String expectedCase) {\n    this.expectedCase = expectedCase;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location, Paths oasObject) {\n    List<OasViolation> violations = new ArrayList<>();\n\n    Set<String> paths = oasObject.keySet();\n\n    for (String path : paths) {\n      if (!matchCamelCase(path)) {\n        OasObjectPropertyLocation pathLoc = location.property(path, OasObjectType.PATH_ITEM);\n        violations.add(new OasViolation(pathLoc, ERROR + expectedCase));\n      }\n    }\n\n    return violations;\n  }\n\n  private boolean matchCamelCase(String path) {\n\n    String[] pathSegments = path.split(\"/\");\n\n    for (String pathSegment : pathSegments) {\n      if (StringUtils.isEmpty(pathSegment)) {\n        continue;\n      }\n      String matchingPart = pathSegment;\n      if (isTemplate(pathSegment)) {\n        matchingPart = extractTemplateVariable(pathSegment);\n      }\n      if (!isMatchCase(expectedCase, matchingPart)) {\n        return false;\n      }\n    }\n    return true;\n\n  }\n\n  private boolean isTemplate(String pathSegment) {\n    return TEMPLATE_PATTERN.matcher(pathSegment).matches();\n  }\n\n  private String extractTemplateVariable(String pathSegment) {\n    Matcher matcher = TEMPLATE_PATTERN.matcher(pathSegment);\n    if (matcher.matches()) {\n      return matcher.group(1);\n    }\n    return \"\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/requestbody/RequestBodyDescriptionRequiredValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.requestbody;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.RequestBodyValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyRequiredValidator;\nimport io.swagger.v3.oas.models.parameters.RequestBody;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#request-body-object\">Request Object</a>\n * .description property validator\n * <ul>\n * <li>config item: requestBody.description.required=*boolean*</li>\n * <li>this field is required</li>\n * </ul>\n */\npublic class RequestBodyDescriptionRequiredValidator\n  extends ObjectPropertyRequiredValidator<RequestBody, String>\n  implements RequestBodyValidator {\n\n  public static final String CONFIG_KEY = \"requestBody.description.required\";\n\n  @Override\n  protected String get$ref(RequestBody oasObject) {\n    return oasObject.get$ref();\n  }\n\n  @Override\n  protected String getPropertyObject(RequestBody oasObject) {\n    return oasObject.getDescription();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"description\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return null;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/response/ResponseHeadersKeysCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.response;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.response.ResponseHeadersKeysValidator;\n\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">ApiResponse Object</a>\n * .headers property key case validator\n * <ul>\n *   <li>config item: response.headers.key.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class ResponseHeadersKeysCaseValidator extends ResponseHeadersKeysValidator {\n\n  public static final String CONFIG_KEY = \"response.headers.key.case\";\n  public static final String ERROR = \"Must be \";\n\n  public ResponseHeadersKeysCaseValidator(String expectedCase) {\n    super(\n        key -> isMatchCase(expectedCase, key),\n        key -> ERROR + expectedCase\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/schema/SchemaPropertiesKeysCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.schema;\n\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.schema.SchemaPropertiesKeysValidator;\n\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject\">Schema Object</a>\n * .properties property key case validator\n * <ul>\n *   <li>config item: schema.properties.key.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class SchemaPropertiesKeysCaseValidator\n    extends SchemaPropertiesKeysValidator {\n\n  public static final String CONFIG_KEY = \"schema.properties.key.case\";\n  public static final String ERROR = \"Must be \";\n\n  public SchemaPropertiesKeysCaseValidator(String expectedCase) {\n    super(\n        key -> isMatchCase(expectedCase, key),\n        key -> ERROR + expectedCase\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/schema/SchemaTitleRequiredValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.schema;\n\nimport io.swagger.v3.oas.models.media.Schema;\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectProperty;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ViolationMessages;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.schema.SchemaRecursiveValidatorTemplate;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.COMPONENTS;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SCHEMA;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject\">Schema Object</a>\n * .title property required validator\n * <ul>\n *   <li>config item: schema.title.required=*boolean*</li>\n *   <li>\n *   if this Schema Object's parent is\n *   <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject\">Schema Object</a>\n *   /\n *   <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject\">Components Object</a>\n *  , then title property is required\n *  </li>\n * </ul>\n */\npublic class SchemaTitleRequiredValidator extends SchemaRecursiveValidatorTemplate {\n\n  public static final String CONFIG_KEY = \"schema.title.required\";\n\n  @Override\n  protected List<OasViolation> validateCurrentSchemaObject(OasValidationContext context, Schema oasObject,\n    OasObjectPropertyLocation location) {\n\n    if (StringUtils.isNotBlank(oasObject.get$ref())) {\n      return emptyList();\n    }\n\n    OasObjectProperty parentProperty = location.getParent();\n\n    if (SCHEMA == parentProperty.getObjectType()\n        || COMPONENTS == parentProperty.getObjectType()\n    ) {\n      return check(oasObject, location);\n    }\n\n    return emptyList();\n  }\n\n  private List<OasViolation> check(Schema oasObject, OasObjectPropertyLocation location) {\n    if (StringUtils.isNotBlank(oasObject.getTitle())) {\n      return emptyList();\n    }\n    return singletonList(\n      new OasViolation(location.property(\"title\", null), ViolationMessages.REQUIRED));\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/tag/TagDescriptionRequiredValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.tag;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.TagValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ObjectPropertyRequiredValidator;\nimport io.swagger.v3.oas.models.tags.Tag;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#tagObject\">Tag Object</a>\n * .description property validator\n * <ul>\n *   <li>config item: tag.description.required=*boolean*</li>\n *   <li>this field is required</li>\n * </ul>\n */\npublic class TagDescriptionRequiredValidator\n  extends ObjectPropertyRequiredValidator<Tag, String>\n  implements TagValidator {\n\n  public static final String CONFIG_KEY = \"tag.description.required\";\n\n  @Override\n  protected String get$ref(Tag oasObject) {\n    return null;\n  }\n\n  @Override\n  protected String getPropertyObject(Tag oasObject) {\n    return oasObject.getDescription();\n  }\n\n  @Override\n  protected String getPropertyName() {\n    return \"description\";\n  }\n\n  @Override\n  protected OasObjectType getPropertyType() {\n    return null;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/tag/TagMustBeReferencedValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.tag;\n\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.TagValidator;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.Operation;\nimport io.swagger.v3.oas.models.PathItem;\nimport io.swagger.v3.oas.models.Paths;\nimport io.swagger.v3.oas.models.tags.Tag;\nimport org.apache.commons.collections4.CollectionUtils;\n\nimport java.util.*;\n\nimport static java.util.Collections.emptySet;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#tagObject\">Tag Object</a>\n * referencing validator\n * <ul>\n *   <li>config item: tag.name.must_be_referenced=*boolean*</li>\n *   <li>\n *   tag object must be referenced by <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\">Operation Object</a>\n *   </li>\n * </ul>\n */\npublic class TagMustBeReferencedValidator implements TagValidator {\n\n  public static final String CONFIG_KEY = \"tag.name.must_be_referenced\";\n  public static final String ERROR = \"Must be referenced by at least one Operation object\";\n\n  private static final String CACHE_KEY = TagMustBeReferencedValidator.class.getName() + \".allOperationsTags\";\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location, Tag tag) {\n    Set<String> allOperationsTags = getAllOperationsTags(context);\n\n    List<OasViolation> violations = new ArrayList<>();\n\n    if (!allOperationsTags.contains(tag.getName())) {\n      violations.add(new OasViolation(location, ERROR));\n    }\n\n    return violations;\n\n  }\n\n  private Set<String> getAllOperationsTags(OasValidationContext context) {\n\n    Set<String> allTags = context.getAttribute(CACHE_KEY);\n    if (allTags != null) {\n      return allTags;\n    }\n\n    allTags = new HashSet<>();\n\n    OpenAPI openAPI = context.getOpenAPI();\n    Paths paths = openAPI.getPaths();\n    if (paths == null) {\n      return emptySet();\n    }\n\n    for (Map.Entry<String, PathItem> entry : paths.entrySet()) {\n      PathItem pathItem = entry.getValue();\n      List<Operation> operations = pathItem.readOperations();\n      for (Operation operation : operations) {\n        List<String> tags = operation.getTags();\n        if (CollectionUtils.isEmpty(tags)) {\n          continue;\n        }\n        allTags.addAll(tags);\n      }\n    }\n\n    context.setAttribute(CACHE_KEY, allTags);\n    return allTags;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/tag/TagNameCaseValidator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.tag;\n\nimport io.swagger.v3.oas.models.tags.Tag;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.TagValidator;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.singletonList;\nimport static org.apache.servicecomb.toolkit.oasv.util.StringCaseUtils.isMatchCase;\n\n/**\n * <a href=\"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#tagObject\">Tag Object</a>\n * .name case validator\n * <ul>\n *   <li>config item: tag.name.case=upper-camel-case/lower-camel-case/upper-hyphen-case</li>\n *   <li>must match case</li>\n * </ul>\n */\npublic class TagNameCaseValidator implements TagValidator {\n\n  public static final String CONFIG_KEY = \"tag.name.case\";\n  public static final String ERROR = \"Must be \";\n\n  private final String expectedCase;\n\n  public TagNameCaseValidator(String expectedCase) {\n    this.expectedCase = expectedCase;\n  }\n\n  @Override\n  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location, Tag tag) {\n\n    if (!isMatchCase(expectedCase, tag.getName())) {\n      return singletonList(new OasViolation(location.property(\"name\"), ERROR + expectedCase));\n    }\n    return emptyList();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/StyleCheckParserTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport org.junit.Test;\n\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\nimport io.swagger.v3.parser.util.ClasspathHelper;\n\npublic class StyleCheckParserTest {\n\n  @Test\n  public void parseYaml() {\n    String yaml = loadRelative(\"parser-test.yaml\");\n    SwaggerParseResult swaggerParseResult = StyleCheckParser.parseYaml(yaml);\n    assertThat(swaggerParseResult).isNotNull();\n    assertThat(swaggerParseResult.getOpenAPI()).isNotNull();\n    assertThat(swaggerParseResult.getMessages()).isEmpty();\n  }\n\n  private String loadRelative(String filename) {\n    String basePath = getClass().getPackage().getName().replaceAll(\"\\\\.\", \"/\");\n    return ClasspathHelper.loadFileFromClasspath(basePath + \"/\" + filename);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultComponentsValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.components.*;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.components.*;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.singletonMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultComponentsValidatorFactoryTest {\n\n  @Autowired\n  private DefaultComponentsValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<ComponentsValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(6);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ComponentsHeadersValuesValidator.class,\n        ComponentsParametersValuesValidator.class,\n        ComponentsRequestBodiesValuesValidator.class,\n        ComponentsResponsesValuesValidator.class,\n        ComponentsSchemasValuesValidator.class,\n        ComponentsSecuritySchemesValuesValidator.class\n    );\n  }\n\n  @Test\n  public void create1() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ComponentsCallbacksKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ComponentsValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(7);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ComponentsHeadersValuesValidator.class,\n        ComponentsParametersValuesValidator.class,\n        ComponentsRequestBodiesValuesValidator.class,\n        ComponentsResponsesValuesValidator.class,\n        ComponentsSchemasValuesValidator.class,\n        ComponentsSecuritySchemesValuesValidator.class,\n        ComponentsCallbacksKeysCaseValidator.class\n    );\n  }\n\n  @Test\n  public void create2() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ComponentsExamplesKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ComponentsValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(7);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ComponentsHeadersValuesValidator.class,\n        ComponentsParametersValuesValidator.class,\n        ComponentsRequestBodiesValuesValidator.class,\n        ComponentsResponsesValuesValidator.class,\n        ComponentsSchemasValuesValidator.class,\n        ComponentsSecuritySchemesValuesValidator.class,\n        ComponentsExamplesKeysCaseValidator.class\n    );\n  }\n\n  @Test\n  public void create3() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ComponentsHeadersKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ComponentsValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(7);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ComponentsHeadersValuesValidator.class,\n        ComponentsParametersValuesValidator.class,\n        ComponentsRequestBodiesValuesValidator.class,\n        ComponentsResponsesValuesValidator.class,\n        ComponentsSchemasValuesValidator.class,\n        ComponentsSecuritySchemesValuesValidator.class,\n        ComponentsHeadersKeysCaseValidator.class\n    );\n  }\n\n  @Test\n  public void create4() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ComponentsLinksKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ComponentsValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(7);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ComponentsHeadersValuesValidator.class,\n        ComponentsParametersValuesValidator.class,\n        ComponentsRequestBodiesValuesValidator.class,\n        ComponentsResponsesValuesValidator.class,\n        ComponentsSchemasValuesValidator.class,\n        ComponentsSecuritySchemesValuesValidator.class,\n        ComponentsLinksKeysCaseValidator.class\n    );\n  }\n\n  @Test\n  public void create5() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ComponentsParametersKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ComponentsValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(7);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ComponentsHeadersValuesValidator.class,\n        ComponentsParametersValuesValidator.class,\n        ComponentsRequestBodiesValuesValidator.class,\n        ComponentsResponsesValuesValidator.class,\n        ComponentsSchemasValuesValidator.class,\n        ComponentsSecuritySchemesValuesValidator.class,\n        ComponentsParametersKeysCaseValidator.class\n    );\n  }\n\n  @Test\n  public void create6() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ComponentsRequestBodiesKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ComponentsValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(7);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ComponentsHeadersValuesValidator.class,\n        ComponentsParametersValuesValidator.class,\n        ComponentsRequestBodiesValuesValidator.class,\n        ComponentsResponsesValuesValidator.class,\n        ComponentsSchemasValuesValidator.class,\n        ComponentsSecuritySchemesValuesValidator.class,\n        ComponentsRequestBodiesKeysCaseValidator.class\n    );\n  }\n\n  @Test\n  public void create7() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ComponentsResponsesKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ComponentsValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(7);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ComponentsHeadersValuesValidator.class,\n        ComponentsParametersValuesValidator.class,\n        ComponentsRequestBodiesValuesValidator.class,\n        ComponentsResponsesValuesValidator.class,\n        ComponentsSchemasValuesValidator.class,\n        ComponentsSecuritySchemesValuesValidator.class,\n        ComponentsResponsesKeysCaseValidator.class\n    );\n  }\n\n  @Test\n  public void create8() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ComponentsSchemasKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ComponentsValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(7);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ComponentsHeadersValuesValidator.class,\n        ComponentsParametersValuesValidator.class,\n        ComponentsRequestBodiesValuesValidator.class,\n        ComponentsResponsesValuesValidator.class,\n        ComponentsSchemasValuesValidator.class,\n        ComponentsSecuritySchemesValuesValidator.class,\n        ComponentsSchemasKeysCaseValidator.class\n    );\n  }\n\n  @Test\n  public void create9() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ComponentsSecuritySchemesKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ComponentsValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(7);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ComponentsHeadersValuesValidator.class,\n        ComponentsParametersValuesValidator.class,\n        ComponentsRequestBodiesValuesValidator.class,\n        ComponentsResponsesValuesValidator.class,\n        ComponentsSchemasValuesValidator.class,\n        ComponentsSecuritySchemesValuesValidator.class,\n        ComponentsSecuritySchemesKeysCaseValidator.class\n    );\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultEncodingValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.encoding.EncodingHeadersKeysCaseValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.EncodingValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.encoding.EncodingHeadersValuesValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.singletonMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultEncodingValidatorFactoryTest {\n\n  @Autowired\n  private DefaultEncodingValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<EncodingValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(1);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        EncodingHeadersValuesValidator.class\n    );\n  }\n\n  @Test\n  public void create1() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(EncodingHeadersKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<EncodingValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(2);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        EncodingHeadersValuesValidator.class,\n        EncodingHeadersKeysCaseValidator.class\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultHeaderValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.header.HeaderDescriptionRequiredValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.HeaderValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.header.HeaderSchemaValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.singletonMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultHeaderValidatorFactoryTest {\n\n  @Autowired\n  private DefaultHeaderValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<HeaderValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(1);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        HeaderSchemaValidator.class\n    );\n  }\n\n  @Test\n  public void create1() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(HeaderDescriptionRequiredValidator.CONFIG_KEY, \"true\"));\n    List<HeaderValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(2);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        HeaderSchemaValidator.class,\n        HeaderDescriptionRequiredValidator.class\n    );\n  }\n\n  @Test\n  public void create2() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(HeaderDescriptionRequiredValidator.CONFIG_KEY, \"false\"));\n    List<HeaderValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(1);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        HeaderSchemaValidator.class\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultInfoValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.info.InfoDescriptionRequiredValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.InfoValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.singletonMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultInfoValidatorFactoryTest {\n\n  @Autowired\n  private DefaultInfoValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<InfoValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(0);\n  }\n\n  @Test\n  public void create1() {\n    FactoryOptions options = new FactoryOptions(singletonMap(InfoDescriptionRequiredValidator.CONFIG_KEY, \"true\"));\n    List<InfoValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(1);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        InfoDescriptionRequiredValidator.class\n    );\n  }\n\n  @Test\n  public void create2() {\n    FactoryOptions options = new FactoryOptions(singletonMap(InfoDescriptionRequiredValidator.CONFIG_KEY, \"false\"));\n    List<InfoValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(0);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultMediaTypeValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.MediaTypeValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.mediatype.MediaTypeEncodingValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.mediatype.MediaTypeSchemaValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultMediaTypeValidatorFactoryTest {\n\n  @Autowired\n  private DefaultMediaTypeValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<MediaTypeValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(2);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        MediaTypeSchemaValidator.class,\n        MediaTypeEncodingValidator.class\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultOasSpecValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport static java.util.Collections.emptyMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultOasSpecValidatorFactoryTest {\n\n  @Autowired\n  private DefaultOasSpecValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    OasSpecValidator validator = validatorFactory.create(options);\n    assertThat(validator).isNotNull();\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultOpenApiValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.openapi.OpenApiSecuritySizeEqValidator;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.openapi.OpenApiTagsSizeGteValidator;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.openapi.OpenApiVersionGteValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OpenApiValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.openapi.*;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.singletonMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultOpenApiValidatorFactoryTest {\n\n  @Autowired\n  private DefaultOpenApiValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<OpenApiValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(5);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        OpenApiTagsValidator.class,\n        OpenApiInfoValidator.class,\n        OpenApiPathsValidator.class,\n        OpenApiComponentsValidator.class,\n        OpenApiServersValidator.class\n    );\n  }\n\n  @Test\n  public void create1() {\n    FactoryOptions options = new FactoryOptions(singletonMap(OpenApiSecuritySizeEqValidator.CONFIG_KEY, \"0\"));\n    List<OpenApiValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(6);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        OpenApiTagsValidator.class,\n        OpenApiInfoValidator.class,\n        OpenApiPathsValidator.class,\n        OpenApiComponentsValidator.class,\n        OpenApiServersValidator.class,\n        OpenApiSecuritySizeEqValidator.class\n    );\n  }\n\n  @Test\n  public void create2() {\n    FactoryOptions options = new FactoryOptions(singletonMap(OpenApiTagsSizeGteValidator.CONFIG_KEY, \"0\"));\n    List<OpenApiValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(6);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        OpenApiTagsValidator.class,\n        OpenApiInfoValidator.class,\n        OpenApiPathsValidator.class,\n        OpenApiComponentsValidator.class,\n        OpenApiServersValidator.class,\n        OpenApiTagsSizeGteValidator.class\n    );\n  }\n\n  @Test\n  public void create3() {\n    FactoryOptions options = new FactoryOptions(singletonMap(OpenApiVersionGteValidator.CONFIG_KEY, \"0\"));\n    List<OpenApiValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(6);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        OpenApiTagsValidator.class,\n        OpenApiInfoValidator.class,\n        OpenApiPathsValidator.class,\n        OpenApiComponentsValidator.class,\n        OpenApiServersValidator.class,\n        OpenApiVersionGteValidator.class\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultOperationValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.operation.*;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OperationValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.operation.OperationParametersValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.operation.OperationRequestBodyValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.operation.OperationResponsesValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.singletonMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultOperationValidatorFactoryTest {\n\n  @Autowired\n  private DefaultOperationValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<OperationValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(3);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        OperationParametersValidator.class,\n        OperationResponsesValidator.class,\n        OperationRequestBodyValidator.class\n    );\n  }\n\n  @Test\n  public void create1() {\n    FactoryOptions options = new FactoryOptions(singletonMap(OperationSummaryRequiredValidator.CONFIG_KEY, \"true\"));\n    List<OperationValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(4);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        OperationParametersValidator.class,\n        OperationResponsesValidator.class,\n        OperationRequestBodyValidator.class,\n        OperationSummaryRequiredValidator.class\n    );\n  }\n\n  @Test\n  public void create2() {\n    FactoryOptions options = new FactoryOptions(singletonMap(OperationSummaryRequiredValidator.CONFIG_KEY, \"false\"));\n    List<OperationValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(3);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        OperationParametersValidator.class,\n        OperationResponsesValidator.class,\n        OperationRequestBodyValidator.class\n    );\n  }\n\n  @Test\n  public void creat3() {\n    FactoryOptions options = new FactoryOptions(singletonMap(OperationIdCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<OperationValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(4);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        OperationParametersValidator.class,\n        OperationResponsesValidator.class,\n        OperationRequestBodyValidator.class,\n        OperationIdCaseValidator.class\n    );\n  }\n\n  @Test\n  public void creat4() {\n    FactoryOptions options = new FactoryOptions(singletonMap(OperationTagsSizeEqValidator.CONFIG_KEY, \"1\"));\n    List<OperationValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(4);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        OperationParametersValidator.class,\n        OperationResponsesValidator.class,\n        OperationRequestBodyValidator.class,\n        OperationTagsSizeEqValidator.class\n    );\n  }\n\n  @Test\n  public void create5() {\n    FactoryOptions options = new FactoryOptions(singletonMap(OperationServersSizeEqValidator.CONFIG_KEY, \"1\"));\n    List<OperationValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(4);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        OperationParametersValidator.class,\n        OperationResponsesValidator.class,\n        OperationRequestBodyValidator.class,\n        OperationServersSizeEqValidator.class\n    );\n  }\n\n  @Test\n  public void create6() {\n    FactoryOptions options = new FactoryOptions(singletonMap(OperationTagsReferenceValidator.CONFIG_KEY, \"true\"));\n    List<OperationValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(4);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        OperationParametersValidator.class,\n        OperationResponsesValidator.class,\n        OperationRequestBodyValidator.class,\n        OperationTagsReferenceValidator.class\n    );\n  }\n\n  @Test\n  public void create7() {\n    FactoryOptions options = new FactoryOptions(singletonMap(OperationTagsReferenceValidator.CONFIG_KEY, \"false\"));\n    List<OperationValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(3);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        OperationParametersValidator.class,\n        OperationResponsesValidator.class,\n        OperationRequestBodyValidator.class\n    );\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultParameterValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.parameter.*;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.parameter.ParameterContentValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.parameter.ParameterSchemaValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.singletonMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultParameterValidatorFactoryTest {\n\n  @Autowired\n  private DefaultParameterValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<ParameterValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(2);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ParameterSchemaValidator.class,\n        ParameterContentValidator.class\n    );\n  }\n\n  @Test\n  public void create1() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ParameterNameCookieCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ParameterValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(3);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ParameterSchemaValidator.class,\n        ParameterContentValidator.class,\n        ParameterNameCookieCaseValidator.class\n    );\n  }\n\n  @Test\n  public void create2() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ParameterNameHeaderCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ParameterValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(3);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ParameterSchemaValidator.class,\n        ParameterContentValidator.class,\n        ParameterNameHeaderCaseValidator.class\n    );\n  }\n\n  @Test\n  public void create3() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ParameterNamePathCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ParameterValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(3);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ParameterSchemaValidator.class,\n        ParameterContentValidator.class,\n        ParameterNamePathCaseValidator.class\n    );\n  }\n\n  @Test\n  public void create4() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ParameterNameQueryCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ParameterValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(3);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ParameterSchemaValidator.class,\n        ParameterContentValidator.class,\n        ParameterNameQueryCaseValidator.class\n    );\n  }\n\n  @Test\n  public void create5() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ParameterDescriptionRequiredValidator.CONFIG_KEY, \"true\"));\n    List<ParameterValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(3);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ParameterSchemaValidator.class,\n        ParameterContentValidator.class,\n        ParameterDescriptionRequiredValidator.class\n    );\n  }\n\n  @Test\n  public void create6() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ParameterDescriptionRequiredValidator.CONFIG_KEY, \"false\"));\n    List<ParameterValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(2);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ParameterSchemaValidator.class,\n        ParameterContentValidator.class\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultPathItemValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.PathItemValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.pathitem.PathItemOperationsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.pathitem.PathItemParametersValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultPathItemValidatorFactoryTest {\n\n  @Autowired\n  private DefaultPathItemValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<PathItemValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(2);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        PathItemOperationsValidator.class,\n        PathItemParametersValidator.class\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultPathsValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.paths.PathsKeyCaseValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.PathsValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.paths.PathsPathItemsValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.singletonMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultPathsValidatorFactoryTest {\n\n  @Autowired\n  private DefaultPathsValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<PathsValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(1);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        PathsPathItemsValidator.class\n    );\n  }\n\n  @Test\n  public void create1() {\n    FactoryOptions options = new FactoryOptions(singletonMap(PathsKeyCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<PathsValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(2);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        PathsPathItemsValidator.class,\n        PathsKeyCaseValidator.class\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultRequestBodyValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.requestbody.RequestBodyDescriptionRequiredValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.RequestBodyValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.requestbody.RequestBodyContentValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.singletonMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultRequestBodyValidatorFactoryTest {\n\n  @Autowired\n  private DefaultRequestBodyValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<RequestBodyValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(1);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        RequestBodyContentValidator.class\n    );\n  }\n\n  @Test\n  public void create1() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(RequestBodyDescriptionRequiredValidator.CONFIG_KEY, \"true\"));\n    List<RequestBodyValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(2);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        RequestBodyContentValidator.class,\n        RequestBodyDescriptionRequiredValidator.class\n    );\n  }\n\n  @Test\n  public void create2() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(RequestBodyDescriptionRequiredValidator.CONFIG_KEY, \"false\"));\n    List<RequestBodyValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(1);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        RequestBodyContentValidator.class\n    );\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultResponseValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.response.ResponseHeadersKeysCaseValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ResponseValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.response.ResponseContentValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.response.ResponseHeadersValuesValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.singletonMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultResponseValidatorFactoryTest {\n\n  @Autowired\n  private DefaultResponseValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<ResponseValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(2);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ResponseContentValidator.class,\n        ResponseHeadersValuesValidator.class\n    );\n  }\n\n  @Test\n  public void create1() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(ResponseHeadersKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<ResponseValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(3);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ResponseContentValidator.class,\n        ResponseHeadersValuesValidator.class,\n        ResponseHeadersKeysCaseValidator.class\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultResponsesValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ResponsesValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.skeleton.responses.ResponsesResponsesValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultResponsesValidatorFactoryTest {\n\n  @Autowired\n  private DefaultResponsesValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<ResponsesValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(1);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        ResponsesResponsesValidator.class\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultSchemaValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.schema.SchemaPropertiesKeysCaseValidator;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.schema.SchemaTitleRequiredValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.SchemaValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.singletonMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultSchemaValidatorFactoryTest {\n\n  @Autowired\n  private DefaultSchemaValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<SchemaValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(0);\n  }\n\n  @Test\n  public void create1() {\n    FactoryOptions options = new FactoryOptions(singletonMap(SchemaTitleRequiredValidator.CONFIG_KEY, \"true\"));\n    List<SchemaValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(1);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        SchemaTitleRequiredValidator.class\n    );\n  }\n\n  @Test\n  public void create2() {\n    FactoryOptions options = new FactoryOptions(singletonMap(SchemaTitleRequiredValidator.CONFIG_KEY, \"false\"));\n    List<SchemaValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(0);\n  }\n\n  @Test\n  public void create3() {\n    FactoryOptions options = new FactoryOptions(\n        singletonMap(SchemaPropertiesKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<SchemaValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(1);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        SchemaPropertiesKeysCaseValidator.class\n    );\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultSecuritySchemeValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.SecuritySchemeValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultSecuritySchemeValidatorFactoryTest {\n\n  @Autowired\n  private DefaultSecuritySchemeValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<SecuritySchemeValidator> validators = validatorFactory.create(options);\n    assertThat(validators).isEmpty();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultServerValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ServerValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultServerValidatorFactoryTest {\n\n  @Autowired\n  private DefaultServerValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<ServerValidator> validators = validatorFactory.create(options);\n    assertThat(validators).isEmpty();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/factory/DefaultTagValidatorFactoryTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.factory;\n\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.tag.TagDescriptionRequiredValidator;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.tag.TagMustBeReferencedValidator;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.tag.TagNameCaseValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.TagValidator;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringRunner;\n\nimport java.util.List;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.singletonMap;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@RunWith(SpringRunner.class)\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class DefaultTagValidatorFactoryTest {\n\n  @Autowired\n  private DefaultTagValidatorFactory validatorFactory;\n\n  @Test\n  public void create() {\n    FactoryOptions options = new FactoryOptions(emptyMap());\n    List<TagValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(0);\n  }\n\n  @Test\n  public void create1() {\n    FactoryOptions options = new FactoryOptions(singletonMap(TagDescriptionRequiredValidator.CONFIG_KEY, \"true\"));\n    List<TagValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(1);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        TagDescriptionRequiredValidator.class\n    );\n  }\n\n  @Test\n  public void create2() {\n    FactoryOptions options = new FactoryOptions(singletonMap(TagDescriptionRequiredValidator.CONFIG_KEY, \"false\"));\n    List<TagValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(0);\n  }\n\n  @Test\n  public void create3() {\n    FactoryOptions options = new FactoryOptions(singletonMap(TagMustBeReferencedValidator.CONFIG_KEY, \"true\"));\n    List<TagValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(1);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        TagMustBeReferencedValidator.class\n    );\n  }\n\n  @Test\n  public void create4() {\n    FactoryOptions options = new FactoryOptions(singletonMap(TagMustBeReferencedValidator.CONFIG_KEY, \"false\"));\n    List<TagValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(0);\n  }\n\n  @Test\n  public void create5() {\n    FactoryOptions options = new FactoryOptions(singletonMap(TagNameCaseValidator.CONFIG_KEY, \"upper-camel-case\"));\n    List<TagValidator> validators = validatorFactory.create(options);\n    assertThat(validators).hasSize(1);\n    assertThat(validators).hasOnlyElementsOfTypes(\n        TagNameCaseValidator.class\n    );\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/OasStyleCheckTestBase.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator;\n\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\nimport io.swagger.v3.parser.util.ClasspathHelper;\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.StyleCheckParser;\nimport org.apache.servicecomb.toolkit.oasv.validation.test.OasValidatorTestBase;\n\nimport java.util.Collections;\n\npublic class OasStyleCheckTestBase extends OasValidatorTestBase {\n\n  @Override\n  protected SwaggerParseResult parseAbsolute(String classpath) {\n    String content = ClasspathHelper.loadFileFromClasspath(classpath);\n    return StyleCheckParser.parseYaml(content);\n  }\n\n  protected FactoryOptions singleOption(String key, String value) {\n    return new FactoryOptions(Collections.singletonMap(key, value));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsCallbacksKeysCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.COMPONENTS;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ComponentsCallbacksKeysCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testUpperCamelCase() {\n    OpenAPI openAPI = loadRelative(\"petstore-callbacks-upper-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ComponentsCallbacksKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(ComponentsCallbacksKeysCaseValidator.ERROR + \"upper-camel-case\",\n          \"components\", COMPONENTS,\n          \"callbacks.'onData'\", null)\n      );\n  }\n\n\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsExamplesKeysCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.COMPONENTS;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ComponentsExamplesKeysCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testUpperCamelCase() {\n    OpenAPI openAPI = loadRelative(\"petstore-examples-upper-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ComponentsExamplesKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(ComponentsExamplesKeysCaseValidator.ERROR + \"upper-camel-case\",\n          \"components\", COMPONENTS,\n          \"examples.'foo'\", null)\n      );\n  }\n\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsHeadersKeysCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.COMPONENTS;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ComponentsHeadersKeysCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testUpperCamelCase() {\n    OpenAPI openAPI = loadRelative(\"petstore-headers-upper-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ComponentsHeadersKeysCaseValidator.CONFIG_KEY, \"upper-hyphen-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(ComponentsHeadersKeysCaseValidator.ERROR + \"upper-hyphen-case\",\n          \"components\", COMPONENTS,\n          \"headers.'foo'\", null)\n      );\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsLinksKeysCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.COMPONENTS;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ComponentsLinksKeysCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testUpperCamelCase() {\n    OpenAPI openAPI = loadRelative(\"petstore-links-upper-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ComponentsLinksKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(ComponentsLinksKeysCaseValidator.ERROR + \"upper-camel-case\",\n          \"components\", COMPONENTS,\n          \"links.'foo'\", null)\n      );\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsParametersKeysCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.COMPONENTS;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ComponentsParametersKeysCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testUpperCamelCase() {\n    OpenAPI openAPI = loadRelative(\"petstore-parameters-upper-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ComponentsParametersKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(ComponentsParametersKeysCaseValidator.ERROR + \"upper-camel-case\",\n          \"components\", COMPONENTS,\n          \"parameters.'foo'\", null)\n      );\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsRequestBodiesKeysCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.COMPONENTS;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ComponentsRequestBodiesKeysCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testUpperCamelCase() {\n    OpenAPI openAPI = loadRelative(\"petstore-request-bodies-upper-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ComponentsRequestBodiesKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n          createViolation(ComponentsRequestBodiesKeysCaseValidator.ERROR + \"upper-camel-case\",\n          \"components\", COMPONENTS,\n          \"requestBodies.'foo'\", null)\n      );\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsResponsesKeysCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.COMPONENTS;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ComponentsResponsesKeysCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testUpperCamelCase() {\n    OpenAPI openAPI = loadRelative(\"petstore-responses-upper-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ComponentsResponsesKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(ComponentsResponsesKeysCaseValidator.ERROR + \"upper-camel-case\",\n          \"components\", COMPONENTS,\n          \"responses.'foo'\", null)\n      );\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsSchemasKeysCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.COMPONENTS;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ComponentsSchemasKeysCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testUpperCamelCase() {\n    OpenAPI openAPI = loadRelative(\"petstore-schemas-upper-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ComponentsSchemasKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(ComponentsSchemasKeysCaseValidator.ERROR + \"upper-camel-case\",\n          \"components\", COMPONENTS,\n          \"schemas.'foo'\", null)\n      );\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/components/ComponentsSecuritySchemesKeysCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.components;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.COMPONENTS;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ComponentsSecuritySchemesKeysCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testUpperCamelCase() {\n    OpenAPI openAPI = loadRelative(\"petstore-security-schemes-upper-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ComponentsSecuritySchemesKeysCaseValidator.CONFIG_KEY, \"upper-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations)\n        .containsExactlyInAnyOrder(\n            createViolation(ComponentsSecuritySchemesKeysCaseValidator.ERROR + \"upper-camel-case\",\n                \"components\", COMPONENTS,\n                \"securitySchemes.'foo'\", null)\n        );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/encoding/EncodingHeadersKeysCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.encoding;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class EncodingHeadersKeysCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate1() {\n    OpenAPI openAPI = loadRelative(\"petstore-encoding-headers-key-case-1.yaml\");\n    OasSpecValidator oasSpecValidator = oasSpecValidator();\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n        createViolation(\n            EncodingHeadersKeysCaseValidator.ERROR + \"upper-hyphen-case\",\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"requestBody\", REQUEST_BODY,\n            \"content.'application/json'\", MEDIA_TYPE,\n            \"encoding.'foo'\", ENCODING,\n            \"headers.'foo-bar'\", null\n        )\n    );\n  }\n\n  @Test\n  public void testValidate2() {\n    OpenAPI openAPI = loadRelative(\"petstore-encoding-headers-key-case-2.yaml\");\n    OasSpecValidator oasSpecValidator = oasSpecValidator();\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n        createViolation(\n            EncodingHeadersKeysCaseValidator.ERROR + \"upper-hyphen-case\",\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"responses\", RESPONSES,\n            \"default\", RESPONSE,\n            \"content.'application/json'\", MEDIA_TYPE,\n            \"encoding.'foo'\", ENCODING,\n            \"headers.'foo-bar'\", null\n        )\n    );\n  }\n\n  @Test\n  public void testValidate3() {\n    OpenAPI openAPI = loadRelative(\"petstore-encoding-headers-key-case-3.yaml\");\n    OasSpecValidator oasSpecValidator = oasSpecValidator();\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n        createViolation(\n            EncodingHeadersKeysCaseValidator.ERROR + \"upper-hyphen-case\",\n            \"components\", COMPONENTS,\n            \"requestBodies.'foo'\", REQUEST_BODY,\n            \"content.'application/json'\", MEDIA_TYPE,\n            \"encoding.'foo'\", ENCODING,\n            \"headers.'foo-bar'\", null\n        )\n    );\n  }\n\n  @Test\n  public void testValidate4() {\n    OpenAPI openAPI = loadRelative(\"petstore-encoding-headers-key-case-4.yaml\");\n    OasSpecValidator oasSpecValidator = oasSpecValidator();\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n        createViolation(\n            EncodingHeadersKeysCaseValidator.ERROR + \"upper-hyphen-case\",\n            \"components\", COMPONENTS,\n            \"responses.'foo'\", RESPONSE,\n            \"content.'application/json'\", MEDIA_TYPE,\n            \"encoding.'foo'\", ENCODING,\n            \"headers.'foo-bar'\", null\n        )\n    );\n  }\n\n  private OasSpecValidator oasSpecValidator() {\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(EncodingHeadersKeysCaseValidator.CONFIG_KEY, \"upper-hyphen-case\")\n        );\n    return oasSpecValidator;\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/header/HeaderDescriptionRequiredValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.header;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ViolationMessages;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class HeaderDescriptionRequiredValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-header-no-desc.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(HeaderDescriptionRequiredValidator.CONFIG_KEY, \"true\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations)\n      .containsExactlyInAnyOrder(\n        createViolation(ViolationMessages.REQUIRED, \"components\", COMPONENTS, \"headers.'X-Pet-Foo'\", HEADER, \"description\", null),\n        createViolation(ViolationMessages.REQUIRED,\n          \"paths\", PATHS,\n          \"/pets\", PATH_ITEM,\n          \"get\", OPERATION,\n          \"responses\", RESPONSES,\n          \"200\", RESPONSE,\n          \"headers.'x-next'\", HEADER,\n          \"description\", null),\n        createViolation(ViolationMessages.REQUIRED,\n          \"paths\", PATHS,\n          \"/pets\", PATH_ITEM,\n          \"get\", OPERATION,\n          \"responses\", RESPONSES,\n          \"201\", RESPONSE,\n          \"content.'application/*'\", MEDIA_TYPE,\n          \"encoding.'abc'\", ENCODING,\n          \"headers.'X-Pet-Foo'\", HEADER,\n          \"description\", null)\n      );\n  }\n\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/info/InfoDescriptionRequiredValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.info;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ViolationMessages;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.INFO;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class InfoDescriptionRequiredValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-info-no-desc.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(InfoDescriptionRequiredValidator.CONFIG_KEY, \"true\")\n        );\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).hasSize(1);\n    assertThat(violations).containsExactly(createViolation(ViolationMessages.REQUIRED, \"info\", INFO, \"description\", null));\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/openapi/OpenApiSecuritySizeEqValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.openapi;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SECURITY_REQUIREMENT;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class OpenApiSecuritySizeEqValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-security-empty.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(OpenApiSecuritySizeEqValidator.CONFIG_KEY, \"0\")\n        );\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations)\n        .containsExactly(\n            createViolation(OpenApiSecuritySizeEqValidator.ERROR + \"0\", \"security\", SECURITY_REQUIREMENT));\n  }\n\n  @Test\n  public void testValidateGood() {\n    OpenAPI openAPI = loadRelative(\"petstore-security-empty-good.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(OpenApiSecuritySizeEqValidator.CONFIG_KEY, \"0\")\n        );\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).isEmpty();\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/openapi/OpenApiTagsSizeGteValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.openapi;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.TAG;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class OpenApiTagsSizeGteValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-tag-not-provided.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(OpenApiTagsSizeGteValidator.CONFIG_KEY, \"1\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).hasSize(1);\n    assertThat(violations).containsExactly(createViolation(OpenApiTagsSizeGteValidator.ERROR + \"1\", \"tags\", TAG));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/openapi/OpenApiVersionGteValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.openapi;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class OpenApiVersionGteValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-openapi-wrong.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(OpenApiVersionGteValidator.CONFIG_KEY, \"3.0.2\")\n        );\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).hasSize(1);\n    assertThat(violations)\n        .containsExactly(createViolation(OpenApiVersionGteValidator.ERROR + \"3.0.2\", \"openapi\", null));\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/operation/OperationIdCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.operation;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class OperationIdCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-operation-id-lower-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(OperationIdCaseValidator.CONFIG_KEY, \"lower-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactly(\n      createViolation(OperationIdCaseValidator.ERROR + \"lower-camel-case\",\n        \"paths\", PATHS,\n        \"/pets\", PATH_ITEM,\n        \"get\", OPERATION,\n        \"operationId\", null));\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/operation/OperationServersSizeEqValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.operation;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class OperationServersSizeEqValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-operation-servers-empty.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(OperationServersSizeEqValidator.CONFIG_KEY, \"0\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactly(\n        createViolation(OperationServersSizeEqValidator.ERROR + \"0\",\n        \"paths\", PATHS,\n        \"/pets\", PATH_ITEM,\n        \"get\", OPERATION,\n        \"servers\", SERVER));\n  }\n\n\n}\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/operation/OperationSummaryRequiredValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.operation;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ViolationMessages;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class OperationSummaryRequiredValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-operation-summary-required.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(OperationSummaryRequiredValidator.CONFIG_KEY, \"true\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactly(\n      createViolation(ViolationMessages.REQUIRED,\n        \"paths\", PATHS,\n        \"/pets\", PATH_ITEM,\n        \"get\", OPERATION,\n        \"summary\", null));\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/operation/OperationTagsReferenceValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.operation;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class OperationTagsReferenceValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-operation-tags-reference.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(OperationTagsReferenceValidator.CONFIG_KEY, \"true\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactly(\n        createViolation(OperationTagsReferenceValidator.ERROR,\n        \"paths\", PATHS,\n        \"/pets\", PATH_ITEM,\n        \"get\", OPERATION,\n        \"tags[0]\", null));\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/operation/OperationTagsSizeEqValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.operation;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class OperationTagsSizeEqValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-operation-tags-only-one.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(OperationTagsSizeEqValidator.CONFIG_KEY, \"1\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactly(\n        createViolation(OperationTagsSizeEqValidator.ERROR + \"1\",\n        \"paths\", PATHS,\n        \"/pets\", PATH_ITEM,\n        \"get\", OPERATION,\n        \"tags\", null));\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/ParameterDescriptionRequiredValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.parameter;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ViolationMessages;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ParameterDescriptionRequiredValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-parameter-desc-none.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ParameterDescriptionRequiredValidator.CONFIG_KEY, \"true\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        ViolationMessages.REQUIRED,\n        \"paths\", PATHS,\n        \"/pets/{petId}\", PATH_ITEM,\n        \"get\", OPERATION,\n        \"parameters[0]\", PARAMETER,\n        \"description\", null\n      ),\n      createViolation(\n        ViolationMessages.REQUIRED,\n        \"components\", COMPONENTS,\n        \"parameters.'Bar'\", PARAMETER,\n        \"description\", null\n      )\n    );\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/ParameterNameCookieCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.parameter;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ParameterNameCookieCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-parameter-cookie-lower-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ParameterNameCookieCaseValidator.CONFIG_KEY, \"lower-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        ParameterNameCookieCaseValidator.ERROR + \"lower-camel-case\",\n        \"paths\", PATHS,\n        \"/pets/{petId}\", PATH_ITEM,\n        \"get\", OPERATION,\n        \"parameters[1]\", PARAMETER,\n        \"name\", null\n      ),\n      createViolation(\n        ParameterNameCookieCaseValidator.ERROR + \"lower-camel-case\",\n        \"components\", COMPONENTS,\n        \"parameters.'Bar'\", PARAMETER,\n        \"name\", null\n      )\n    );\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/ParameterNameHeaderCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.parameter;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ParameterNameHeaderCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-parameter-header-upper-hyphen-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ParameterNameHeaderCaseValidator.CONFIG_KEY, \"upper-hyphen-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        ParameterNameHeaderCaseValidator.ERROR + \"upper-hyphen-case\",\n        \"paths\", PATHS,\n        \"/pets/{petId}\", PATH_ITEM,\n        \"get\", OPERATION,\n        \"parameters[1]\", PARAMETER,\n        \"name\", null\n      ),\n      createViolation(\n        ParameterNameHeaderCaseValidator.ERROR + \"upper-hyphen-case\",\n        \"components\", COMPONENTS,\n        \"parameters.'Bar'\", PARAMETER,\n        \"name\", null\n      )\n    );\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/ParameterNamePathCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.parameter;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ParameterNamePathCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-parameter-path-lower-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ParameterNamePathCaseValidator.CONFIG_KEY, \"lower-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        ParameterNamePathCaseValidator.ERROR + \"lower-camel-case\",\n        \"paths\", PATHS,\n        \"/pets/{PetId}\", PATH_ITEM,\n        \"get\", OPERATION,\n        \"parameters[0]\", PARAMETER,\n        \"name\", null\n      ),\n      createViolation(\n        ParameterNamePathCaseValidator.ERROR + \"lower-camel-case\",\n        \"components\", COMPONENTS,\n        \"parameters.'Bar'\", PARAMETER,\n        \"name\", null\n      )\n    );\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/ParameterNameQueryCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.parameter;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ParameterNameQueryCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-parameter-query-lower-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ParameterNameQueryCaseValidator.CONFIG_KEY, \"lower-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        ParameterNameQueryCaseValidator.ERROR + \"lower-camel-case\",\n        \"paths\", PATHS,\n        \"/pets/{petId}\", PATH_ITEM,\n        \"get\", OPERATION,\n        \"parameters[1]\", PARAMETER,\n        \"name\", null\n      ),\n      createViolation(\n        ParameterNameQueryCaseValidator.ERROR + \"lower-camel-case\",\n        \"components\", COMPONENTS,\n        \"parameters.'Bar'\", PARAMETER,\n        \"name\", null\n      )\n    );\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/paths/PathsKeyCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.paths;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PATHS;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.PATH_ITEM;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class PathsKeyCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-paths-lower-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(PathsKeyCaseValidator.CONFIG_KEY, \"lower-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        PathsKeyCaseValidator.ERROR + \"lower-camel-case\",\n        \"paths\", PATHS,\n        \"/pets/{PetId}\", PATH_ITEM\n      ),\n      createViolation(\n        PathsKeyCaseValidator.ERROR + \"lower-camel-case\",\n        \"paths\", PATHS,\n        \"/Pets\", PATH_ITEM\n      )\n    );\n  }\n\n\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/requestbody/RequestBodyDescriptionRequiredValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.requestbody;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ViolationMessages;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class RequestBodyDescriptionRequiredValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-request-body-desc-required.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(RequestBodyDescriptionRequiredValidator.CONFIG_KEY, \"true\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        ViolationMessages.REQUIRED,\n        \"paths\", PATHS,\n        \"/pets\", PATH_ITEM,\n        \"post\", OPERATION,\n        \"requestBody\", REQUEST_BODY,\n        \"description\", null\n      ),\n      createViolation(\n        ViolationMessages.REQUIRED,\n        \"components\", COMPONENTS,\n        \"requestBodies.'Foo'\", REQUEST_BODY,\n        \"description\", null\n      )\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/response/ResponseHeadersKeysCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.response;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class ResponseHeadersKeysCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-response-headers-key-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(ResponseHeadersKeysCaseValidator.CONFIG_KEY, \"upper-hyphen-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n        createViolation(\n            ResponseHeadersKeysCaseValidator.ERROR + \"upper-hyphen-case\",\n            \"paths\", PATHS,\n            \"/pets\", PATH_ITEM,\n            \"post\", OPERATION,\n            \"responses\", RESPONSES,\n            \"default\", RESPONSE,\n            \"headers.'foo-bar'\", null\n        ),\n        createViolation(\n            ResponseHeadersKeysCaseValidator.ERROR + \"upper-hyphen-case\",\n            \"components\", COMPONENTS,\n            \"responses.'foo'\", RESPONSE,\n            \"headers.'foo-bar'\", null\n        )\n    );\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/schema/SchemaPropertiesKeysCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.schema;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class SchemaPropertiesKeysCaseValidatorTest extends OasStyleCheckTestBase {\n\n\n  @Test\n  public void testValidateParameter1() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-p-keys-lower-camel-case-param-1.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        SchemaPropertiesKeysCaseValidator.ERROR + \"lower-camel-case\",\n        \"paths\", PATHS,\n        \"/pets\", PATH_ITEM,\n        \"get\", OPERATION,\n        \"parameters[0]\", PARAMETER,\n        \"schema\", SCHEMA,\n        \"properties.'Foo'\", null\n      )\n    );\n  }\n\n  @Test\n  public void testValidateParameter2() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-p-keys-lower-camel-case-param-2.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        SchemaPropertiesKeysCaseValidator.ERROR + \"lower-camel-case\",\n        \"components\", COMPONENTS,\n        \"parameters.'Foo'\", PARAMETER,\n        \"schema\", SCHEMA,\n        \"properties.'Foo'\", null\n      )\n    );\n  }\n\n  @Test\n  public void testResponse1() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-p-keys-lower-camel-case-resp-1.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        SchemaPropertiesKeysCaseValidator.ERROR + \"lower-camel-case\",\n        \"paths\", PATHS,\n        \"/pets\", PATH_ITEM,\n        \"get\", OPERATION,\n        \"responses\", RESPONSES,\n        \"200\", RESPONSE,\n        \"content.'application/json'\", MEDIA_TYPE,\n        \"schema\", SCHEMA,\n        \"properties.'Foo'\", null\n      )\n    );\n  }\n\n  @Test\n  public void testResponse2() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-p-keys-lower-camel-case-resp-2.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        SchemaPropertiesKeysCaseValidator.ERROR + \"lower-camel-case\",\n        \"components\", COMPONENTS,\n        \"responses.'Foo'\", RESPONSE,\n        \"content.'application/json'\", MEDIA_TYPE,\n        \"schema\", SCHEMA,\n        \"properties.'Foo'\", null\n      )\n    );\n  }\n\n  @Test\n  public void testRequestBody1() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-p-keys-lower-camel-case-req-1.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        SchemaPropertiesKeysCaseValidator.ERROR + \"lower-camel-case\",\n        \"paths\", PATHS,\n        \"/pets\", PATH_ITEM,\n        \"post\", OPERATION,\n        \"requestBody\", REQUEST_BODY,\n        \"content.'application/json'\", MEDIA_TYPE,\n        \"schema\", SCHEMA,\n        \"properties.'Foo'\", null\n      )\n    );\n  }\n\n  @Test\n  public void testRequestBody2() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-p-keys-lower-camel-case-req-2.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        SchemaPropertiesKeysCaseValidator.ERROR + \"lower-camel-case\",\n        \"components\", COMPONENTS,\n        \"requestBodies.'Foo'\", REQUEST_BODY,\n        \"content.'application/json'\", MEDIA_TYPE,\n        \"schema\", SCHEMA,\n        \"properties.'Foo'\", null\n      )\n    );\n  }\n\n  @Test\n  public void testComponent() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-p-keys-lower-camel-case-comp.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        SchemaPropertiesKeysCaseValidator.ERROR + \"lower-camel-case\",\n        \"components\", COMPONENTS,\n        \"schemas.'Foo'\", SCHEMA,\n        \"properties.'Foo'\", null\n      )\n    );\n  }\n\n  @Test\n  public void testNested() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-p-keys-lower-camel-case-nested.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        SchemaPropertiesKeysCaseValidator.ERROR + \"lower-camel-case\",\n        \"components\", COMPONENTS,\n        \"schemas.'Foo'\", SCHEMA,\n        \"properties.'Foo'\", null\n      ),\n      createViolation(\n        SchemaPropertiesKeysCaseValidator.ERROR + \"lower-camel-case\",\n        \"components\", COMPONENTS,\n        \"schemas.'Foo'\", SCHEMA,\n        \"properties.'Foo'\", SCHEMA,\n        \"properties.'Bar'\", null\n      )\n    );\n  }\n\n  @Test\n  public void testAllOf() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-p-keys-lower-camel-case-all-of.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        SchemaPropertiesKeysCaseValidator.ERROR + \"lower-camel-case\",\n        \"components\", COMPONENTS,\n        \"schemas.'Foo'\", SCHEMA,\n        \"allOf[0]\", SCHEMA,\n        \"properties.'Foo'\", null\n      )\n    );\n  }\n\n  @Test\n  public void testAnyOf() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-p-keys-lower-camel-case-any-of.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        SchemaPropertiesKeysCaseValidator.ERROR + \"lower-camel-case\",\n        \"components\", COMPONENTS,\n        \"schemas.'Foo'\", SCHEMA,\n        \"anyOf[0]\", SCHEMA,\n        \"properties.'Foo'\", null\n      )\n    );\n  }\n\n  @Test\n  public void testOneOf() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-p-keys-lower-camel-case-one-of.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        SchemaPropertiesKeysCaseValidator.ERROR + \"lower-camel-case\",\n        \"components\", COMPONENTS,\n        \"schemas.'Foo'\", SCHEMA,\n        \"oneOf[0]\", SCHEMA,\n        \"properties.'Foo'\", null\n      )\n    );\n  }\n\n  @Test\n  public void testArray() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-p-keys-lower-camel-case-array.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        SchemaPropertiesKeysCaseValidator.ERROR + \"lower-camel-case\",\n        \"components\", COMPONENTS,\n        \"schemas.'Foo'\", SCHEMA,\n        \"items\", SCHEMA,\n        \"properties.'Foo'\", null\n      )\n    );\n  }\n\n  private OasSpecValidator createOasSpecValidator() {\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(SchemaPropertiesKeysCaseValidator.CONFIG_KEY, \"lower-camel-case\")\n        );\n    return oasSpecValidator;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/schema/SchemaTitleRequiredValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.schema;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ViolationMessages;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.COMPONENTS;\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.SCHEMA;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class SchemaTitleRequiredValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidateComponents() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-title-comp.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        ViolationMessages.REQUIRED,\n        \"components\", COMPONENTS,\n        \"schemas.'Foo'\", SCHEMA,\n        \"title\", null\n      )\n    );\n  }\n  @Test\n  public void testValidateNested() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-title-nested.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).containsExactlyInAnyOrder(\n      createViolation(\n        ViolationMessages.REQUIRED,\n        \"components\", COMPONENTS,\n        \"schemas.'Foo'\", SCHEMA,\n        \"properties.'Foo'\", SCHEMA,\n        \"title\", null\n      )\n    );\n  }\n\n  @Test\n  public void testValidateParameter() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-title-param.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).isEmpty();\n  }\n\n  @Test\n  public void testValidateRequestBody() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-title-req.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).isEmpty();\n  }\n\n  @Test\n  public void testValidateResponse() {\n    OpenAPI openAPI = loadRelative(\"petstore-schema-title-resp.yaml\");\n    OasSpecValidator oasSpecValidator = createOasSpecValidator();\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).isEmpty();\n  }\n\n\n  private OasSpecValidator createOasSpecValidator() {\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(SchemaTitleRequiredValidator.CONFIG_KEY, \"true\")\n        );\n    return oasSpecValidator;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/tag/TagDescriptionRequiredValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.tag;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.ViolationMessages;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.TAG;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class TagDescriptionRequiredValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-tag-no-desc.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(TagDescriptionRequiredValidator.CONFIG_KEY, \"true\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).hasSize(1);\n    assertThat(violations)\n      .containsExactly(createViolation(ViolationMessages.REQUIRED, \"tags[0]\", TAG, \"description\", null));\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/tag/TagMustBeReferencedValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.tag;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.TAG;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class TagMustBeReferencedValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-tag-redundant.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(TagMustBeReferencedValidator.CONFIG_KEY, \"true\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).hasSize(1);\n    assertThat(violations)\n        .containsExactly(createViolation(TagMustBeReferencedValidator.ERROR, \"tags[1]\", TAG));\n  }\n\n}\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/java/org/apache/servicecomb/toolkit/oasv/style/validator/tag/TagNameCaseValidatorTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.style.validator.tag;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.apache.servicecomb.toolkit.oasv.style.validator.OasStyleCheckTestBase;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.junit.Test;\nimport org.springframework.test.context.ContextConfiguration;\n\nimport java.util.List;\n\nimport static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.TAG;\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ContextConfiguration(classes = ValidatorFactoryComponents.class)\npublic class TagNameCaseValidatorTest extends OasStyleCheckTestBase {\n\n  @Test\n  public void testValidate() {\n    OpenAPI openAPI = loadRelative(\"petstore-tag-name-not-upper-camel-case.yaml\");\n    OasSpecValidator oasSpecValidator =\n        oasSpecValidatorFactory.create(\n            singleOption(TagNameCaseValidator.CONFIG_KEY, \"upper-camel-case\")\n        );\n\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    assertThat(violations).hasSize(1);\n    assertThat(violations)\n        .containsExactly(\n            createViolation(TagNameCaseValidator.ERROR + \"upper-camel-case\", \"tags[0]\", TAG, \"name\", null));\n  }\n\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/logback-test.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<configuration>\n  <include resource=\"org/springframework/boot/logging/logback/base.xml\" />\n  <logger name=\"org.springframework\" level=\"OFF\"/>\n</configuration>\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/parser-test.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Pet petstore\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listpets\n      responses:\n        '200':\n          description: A paged array of pets\n\n    post:\n      summary: List all pets\n      operationId: foo\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                foo:\n                  type: string\n                bar:\n                  type: string\n            encoding:\n              foo:\n                contentType: 'application/octet-stream'\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/components/petstore-callbacks-upper-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n  callbacks:\n    onData:\n      '{$request.query.callbackUrl}/data':\n        post:\n          requestBody:\n            description: subscription payload\n            content:\n              application/json:\n                schema:\n                  properties:\n                    timestamp:\n                      type: string\n                      format: date-time\n                    userData:\n                      type: string\n          responses:\n            '202':\n              description: |\n                Your server implementation should return this HTTP status code\n                if the data was received successfully\n    OnData:\n      '{$request.query.callbackUrl}/data':\n        post:\n          requestBody:\n            description: subscription payload\n            content:\n              application/json:\n                schema:\n                  properties:\n                    timestamp:\n                      type: string\n                      format: date-time\n                    userData:\n                      type: string\n          responses:\n            '202':\n              description: |\n                Your server implementation should return this HTTP status code\n                if the data was received successfully\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/components/petstore-examples-upper-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n  examples:\n    foo:\n      description: abc\n    Foo:\n      description: xyz\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/components/petstore-headers-upper-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n  headers:\n    foo:\n      description: blah blah\n    X-Foo:\n      description: blah blah\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/components/petstore-links-upper-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n  links:\n    foo:\n      description: abc\n    Foo:\n      description: abc\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/components/petstore-parameters-upper-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n  parameters:\n    foo:\n      in: query\n      name: foo\n      schema:\n        type: string\n    Foo:\n      in: query\n      name: foo\n      schema:\n        type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/components/petstore-request-bodies-upper-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n    foo:\n      required:\n        - code\n      properties:\n        code:\n          type: string\n  requestBodies:\n    foo:\n      description: blah\n      content:\n        text/plain:\n          schema:\n            type: string\n    Foo:\n      description: blah\n      content:\n        text/plain:\n          schema:\n            type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/components/petstore-responses-upper-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n  responses:\n    foo:\n      description: blah blah\n    Foo:\n      description: blah blah\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/components/petstore-schemas-upper-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n    foo:\n      required:\n        - code\n      properties:\n        code:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/components/petstore-security-schemes-upper-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\ncomponents:\n  securitySchemes:\n    foo:\n      type: http\n      scheme: http\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/encoding/petstore-encoding-headers-key-case-1.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: Create a pet\n      operationId: createPets\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: string\n            encoding:\n              foo:\n                contentType: application/json\n                headers:\n                  foo-bar:\n                    schema:\n                      type: string\n      responses:\n        default:\n          description: unexpected error\n          headers:\n            foo:\n              schema:\n                type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/encoding/petstore-encoding-headers-key-case-2.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: Create a pet\n      operationId: createPets\n      responses:\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                type: string\n              encoding:\n                foo:\n                  contentType: application/json\n                  headers:\n                    foo-bar:\n                      schema:\n                        type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/encoding/petstore-encoding-headers-key-case-3.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: Create a pet\n      operationId: createPets\n      responses:\n        default:\n          description: unexpected error\n          headers:\n            foo:\n              schema:\n                type: string\n\ncomponents:\n  requestBodies:\n    foo:\n      content:\n        application/json:\n          schema:\n            type: string\n          encoding:\n            foo:\n              contentType: application/json\n              headers:\n                foo-bar:\n                  schema:\n                    type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/encoding/petstore-encoding-headers-key-case-4.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: Create a pet\n      operationId: createPets\n      responses:\n        default:\n          description: unexpected error\n          headers:\n            foo:\n              schema:\n                type: string\n\ncomponents:\n  responses:\n    foo:\n      description: unexpected error\n      content:\n        application/json:\n          schema:\n            type: string\n          encoding:\n            foo:\n              contentType: application/json\n              headers:\n                foo-bar:\n                  schema:\n                    type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/header/petstore-header-no-desc.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              schema:\n                type: string\n            X-Pet-Bar:\n              $ref: '#/components/headers/X-Pet-Foo'\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        '201':\n          description: A paged array of pets\n          content:\n            application/*:\n              encoding:\n                abc:\n                  contentType: application/json\n                  headers:\n                    X-Pet-Foo:\n                      schema:\n                        type: string\n                    X-Pet-Bar:\n                      $ref: '#/components/headers/X-Pet-Foo'\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  headers:\n    X-Pet-Foo:\n      schema:\n        type: string\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/info/petstore-info-no-desc.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/openapi/petstore-openapi-wrong.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/openapi/petstore-security-empty-good.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/openapi/petstore-security-empty.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\nsecurity:\n  - oauth2:\n      - foo\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/openapi/petstore-tag-not-provided.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/operation/petstore-operation-id-lower-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: ListPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/operation/petstore-operation-servers-empty.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\n      servers:\n        - url: http://localhost:8080\n    post:\n      operationId: showPetById\n      responses:\n        '200':\n          description: Expected response to a valid request\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/operation/petstore-operation-summary-required.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/operation/petstore-operation-tags-only-one.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n        - dogs\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/operation/petstore-operation-tags-reference.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\ntags:\n  - name: pets\n    description: blah blah\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - dogs\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/petstore-parameter-cookie-lower-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          schema:\n            type: string\n        - name: Bar\n          in: cookie\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n  parameters:\n    Bar:\n      in: cookie\n      name: Bar\n      schema:\n        type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/petstore-parameter-desc-none.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n  parameters:\n    Bar:\n      in: query\n      name: bar\n      schema:\n        type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/petstore-parameter-header-upper-hyphen-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          schema:\n            type: string\n        - name: x-bar\n          in: header\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n  parameters:\n    Bar:\n      in: header\n      name: x-bar\n      schema:\n        type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/petstore-parameter-path-lower-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets/{PetId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: PetId\n          in: path\n          required: true\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n  parameters:\n    Bar:\n      in: path\n      name: Bar\n      schema:\n        type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/parameter/petstore-parameter-query-lower-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          schema:\n            type: string\n        - name: Bar\n          in: query\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n  parameters:\n    Bar:\n      in: query\n      name: Bar\n      schema:\n        type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/paths/petstore-paths-lower-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /Pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets:\n    get:\n      operationId: listPets2\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n\n  /pets/{PetId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: PetId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/requestbody/petstore-request-body-desc-required.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      requestBody:\n        content:\n          text/plain:\n            schema:\n              type: string\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n  requestBodies:\n    Foo:\n      content:\n        application/json:\n          schema:\n            type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/response/petstore-response-headers-key-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: Create a pet\n      operationId: createPets\n      responses:\n        default:\n          description: unexpected error\n          headers:\n            foo-bar:\n              schema:\n                type: string\ncomponents:\n  responses:\n    foo:\n      description: unexpected error\n      headers:\n        foo-bar:\n          schema:\n            type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-p-keys-lower-camel-case-all-of.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\ncomponents:\n  schemas:\n    Foo:\n      allOf:\n        - type: object\n          properties:\n            Foo:\n              type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-p-keys-lower-camel-case-any-of.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\ncomponents:\n  schemas:\n    Foo:\n      anyOf:\n        - type: object\n          properties:\n            Foo:\n              type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-p-keys-lower-camel-case-array.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\ncomponents:\n  schemas:\n    Foo:\n      type: array\n      items:\n        type: object\n        properties:\n          Foo:\n            type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-p-keys-lower-camel-case-comp.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\ncomponents:\n  schemas:\n    Foo:\n      type: object\n      properties:\n        Foo:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-p-keys-lower-camel-case-nested.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\ncomponents:\n  schemas:\n    Foo:\n      type: object\n      properties:\n        Foo:\n          type: object\n          properties:\n            Bar:\n              type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-p-keys-lower-camel-case-one-of.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\ncomponents:\n  schemas:\n    Foo:\n      oneOf:\n        - type: object\n          properties:\n            Foo:\n              type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-p-keys-lower-camel-case-param-1.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      operationId: listPets\n      parameters:\n        - name: foo\n          in: query\n          schema:\n            type: object\n            properties:\n              Foo:\n                type: string\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-p-keys-lower-camel-case-param-2.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\ncomponents:\n  parameters:\n    Foo:\n      in: query\n      name: Foo\n      schema:\n        type: object\n        properties:\n          Foo:\n            type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-p-keys-lower-camel-case-req-1.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: Create a pet\n      operationId: createPets\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                Foo:\n                  type: string\n      responses:\n        '201':\n          description: Null response\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-p-keys-lower-camel-case-req-2.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: Create a pet\n      operationId: createPets\n      responses:\n        '201':\n          description: Null response\ncomponents:\n  requestBodies:\n    Foo:\n      content:\n        application/json:\n          schema:\n            type: object\n            properties:\n              Foo:\n                type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-p-keys-lower-camel-case-resp-1.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  Foo:\n                    type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-p-keys-lower-camel-case-resp-2.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\n\ncomponents:\n  responses:\n    Foo:\n      description: A paged array of pets\n      content:\n        application/json:\n          schema:\n            type: object\n            properties:\n              Foo:\n                type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-title-comp.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\ncomponents:\n  schemas:\n    Foo:\n      type: string\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-title-nested.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\ncomponents:\n  schemas:\n    Foo:\n      title: blah blah\n      type: object\n      properties:\n        Foo:\n          type: string\n\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-title-param.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: List all pets\n      operationId: listPets\n      parameters:\n        - name: foo\n          in: query\n          schema:\n            type: string\n      responses:\n        '200':\n          description: A paged array of pets\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-title-req.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: List all pets\n      operationId: listPets\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: string\n      responses:\n        '200':\n          description: A paged array of pets\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/schema/petstore-schema-title-resp.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    post:\n      summary: List all pets\n      operationId: listPets\n      responses:\n        '200':\n          description: A paged array of pets\n          content:\n            application/json:\n              schema:\n                type: string\n\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/tag/petstore-tag-name-not-upper-camel-case.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\ntags:\n  - name: pets\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/tag/petstore-tag-no-desc.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\ntags:\n  - name: pets\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-style/src/test/resources/org/apache/servicecomb/toolkit/oasv/style/validator/tag/petstore-tag-redundant.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\ntags:\n  - name: pets\n  - name: foo\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-test/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n  <parent>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>oas-validator-parent</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <relativePath>../pom.xml</relativePath>\n  </parent>\n\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>oas-validator-test</artifactId>\n\n  <dependencies>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-core</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-test</artifactId>\n    </dependency>\n\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-plugin</artifactId>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-report-plugin</artifactId>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>\n"
  },
  {
    "path": "oas-validator/oas-validator-test/src/main/java/org/apache/servicecomb/toolkit/oasv/OasSpecLoader.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\nimport org.apache.commons.collections4.CollectionUtils;\nimport org.apache.commons.lang3.StringUtils;\n\npublic abstract class OasSpecLoader {\n\n  /**\n   * Parse file at absolute path\n   *\n   * @param classpath\n   * @return\n   */\n  protected abstract SwaggerParseResult parseAbsolute(String classpath);\n\n\n  /**\n   * Load file at absolute path\n   *\n   * @param classpath\n   * @return\n   */\n  protected final OpenAPI loadAbsolute(String classpath) {\n    SwaggerParseResult parseResult = parseAbsolute(classpath);\n    if (CollectionUtils.isNotEmpty(parseResult.getMessages())) {\n      throw new RuntimeException(StringUtils.join(parseResult.getMessages(), \",\"));\n    }\n    return parseResult.getOpenAPI();\n  }\n\n  /**\n   * Load file at relative path\n   *\n   * @param fileName\n   * @return\n   */\n  protected final OpenAPI loadRelative(String fileName) {\n    String basePath = getClass().getPackage().getName().replaceAll(\"\\\\.\", \"/\");\n    return loadAbsolute(basePath + \"/\" + fileName);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-test/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/test/OasDiffValidatorTestBase.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.diffvalidation.test;\n\nimport org.apache.servicecomb.toolkit.oasv.OasSpecLoader;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasSpecDiffValidator;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\npublic abstract class OasDiffValidatorTestBase extends OasSpecLoader {\n\n  @Autowired\n  protected OasSpecDiffValidator oasSpecDiffValidator;\n\n  protected final OasDiffValidationContext createContext(OpenAPI leftOpenAPI, OpenAPI rightOpenAPI) {\n    OasDiffValidationContext context = new OasDiffValidationContext(leftOpenAPI, rightOpenAPI);\n    return context;\n  }\n\n  protected void initContext(OasDiffValidationContext context) {\n  }\n\n  /**\n   * create violation with location swhich are same on both side\n   *\n   * @param error\n   * @param path\n   * @return\n   */\n  protected final OasDiffViolation createViolationBoth(String error, Object[] path) {\n    OasObjectPropertyLocation location = createLocation(path);\n    return new OasDiffViolation(location, location, error);\n  }\n\n  protected final OasDiffViolation createViolationLeft(String error, Object[] leftPath) {\n    return new OasDiffViolation(createLocation(leftPath), null, error);\n  }\n\n  protected final OasDiffViolation createViolationRight(String error, Object[] rightPath) {\n    return new OasDiffViolation(null, createLocation(rightPath), error);\n  }\n\n  protected final OasDiffViolation createViolation(String error, Object[] leftPath, Object[] rightPath) {\n    return new OasDiffViolation(createLocation(leftPath), createLocation(rightPath), error);\n  }\n\n  private final OasObjectPropertyLocation createLocation(Object[] path) {\n    if (path == null) {\n      return null;\n    }\n    OasObjectPropertyLocation loc = OasObjectPropertyLocation.root();\n    for (int i = 0; i < path.length; i = i + 2) {\n      loc = loc.property((String) path[i], (OasObjectType) path[i + 1]);\n    }\n    return loc;\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-test/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/test/OasValidatorTestBase.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.validation.test;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport org.apache.servicecomb.toolkit.oasv.OasSpecLoader;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectPropertyLocation;\nimport org.apache.servicecomb.toolkit.oasv.common.OasObjectType;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.OasSpecValidatorFactory;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\npublic abstract class OasValidatorTestBase extends OasSpecLoader {\n\n  @Autowired\n  protected OasSpecValidatorFactory oasSpecValidatorFactory;\n\n  final protected OasValidationContext createContext(OpenAPI openAPI) {\n    OasValidationContext oasValidationContext = new OasValidationContext(openAPI);\n    initContext(oasValidationContext);\n    return oasValidationContext;\n  }\n\n  protected void initContext(OasValidationContext context) {\n  }\n\n  final protected OasViolation createViolation(String error, Object... path) {\n    OasObjectPropertyLocation loc = OasObjectPropertyLocation.root();\n    for (int i = 0; i < path.length; i = i + 2) {\n      loc = loc.property((String) path[i], (OasObjectType) path[i + 1]);\n    }\n    return new OasViolation(loc, error);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-web/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n  <parent>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>oas-validator-parent</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <relativePath>../pom.xml</relativePath>\n  </parent>\n\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>oas-validator-web</artifactId>\n  \n  <properties>\n    <start-class>org.apache.servicecomb.toolkit.oasv.web.Application</start-class>\n    \n  </properties>\n\n  <dependencies>\n\n    <dependency>\n      <groupId>org.projectlombok</groupId>\n      <artifactId>lombok</artifactId>\n      <scope>provided</scope>\n    </dependency>\n\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-core-spring</artifactId>\n    </dependency>\n    \n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-compatibility-spring</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-style</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter</artifactId>\n    </dependency>\n\n    <!-- 微服务 健康监控 -->\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-actuator</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-web</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-thymeleaf</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.webjars</groupId>\n      <artifactId>bootstrap</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-test</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n  </dependencies>\n\n  <build>\n\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-plugin</artifactId>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-surefire-report-plugin</artifactId>\n      </plugin>\n\n      <plugin>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-maven-plugin</artifactId>\n        <executions>\n          <execution>\n            <id>boot-repackage</id>\n            <phase>package</phase>\n            <goals>\n              <goal>repackage</goal>\n            </goals>\n          </execution>\n        </executions>\n        <configuration>\n          <classifier>exec</classifier>\n        </configuration>\n      </plugin>\n\n    </plugins>\n  </build>\n\n</project>\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/java/org/apache/servicecomb/toolkit/oasv/web/Application.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.web;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.web.cors.CorsConfiguration;\nimport org.springframework.web.cors.UrlBasedCorsConfigurationSource;\nimport org.springframework.web.filter.CorsFilter;\n\n@SpringBootApplication\npublic class Application {\n\n  public static void main(String[] args) {\n    SpringApplication.run(Application.class, args);\n  }\n  \n  @Bean\n  public CorsFilter corsFilter() {\n      final CorsConfiguration config = new CorsConfiguration();\n      //config.setAllowCredentials(true);\n      config.addAllowedOrigin(\"*\");\n      config.addAllowedHeader(\"*\");\n      config.addAllowedMethod(\"*\");\n\n      final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();\n      source.registerCorsConfiguration(\"/api/**\", config);\n\n      return new CorsFilter(source);\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/java/org/apache/servicecomb/toolkit/oasv/web/api/controller/CompatibilityController.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.web.api.controller;\n\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\nimport org.apache.commons.collections4.CollectionUtils;\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.oasv.compatibility.CompatibilityCheckParser;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasSpecDiffValidator;\nimport org.apache.servicecomb.toolkit.oasv.util.SyntaxChecker;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.http.HttpStatus;\nimport org.springframework.util.MimeTypeUtils;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.ResponseStatus;\nimport org.springframework.web.bind.annotation.RestController;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\n\n@RestController\n@RequestMapping(\"/api/compatibility\")\npublic class CompatibilityController {\n\n  @Autowired\n  private OasSpecDiffValidator oasSpecDiffValidator;\n\n  @PostMapping(consumes = MimeTypeUtils.TEXT_PLAIN_VALUE, produces = MimeTypeUtils.APPLICATION_JSON_VALUE)\n  @ResponseStatus(value = HttpStatus.OK)\n  public Map<String, Object> validateOpenAPI(@RequestBody String yaml) {\n    \n    Map<String, Object> json = new HashMap<>();\n    \n    json.put(\"acknowleged\", true);\n    json.put(\"data\", doValidate(yaml));\n    \n    return json;\n  }\n\n\n  private ImportError2 doValidate(String yaml) {\n\n    ImportError2 importError = new ImportError2();\n\n    String leftYaml = yaml.split(\"---\\n\")[0];\n    String rightYaml = yaml.split(\"---\\n\")[1];\n\n    importError.addLeftParseErrors(SyntaxChecker.check(leftYaml));\n    importError.addRightParseErrors(SyntaxChecker.check(rightYaml));\n\n    if (importError.isNotEmpty()) {\n      return importError;\n    }\n\n    OpenAPI leftOpenAPI = loadByYaml(leftYaml);\n    OpenAPI rightOpenAPI = loadByYaml(rightYaml);\n\n    List<OasDiffViolation> violations = oasSpecDiffValidator\n        .validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);\n    if (CollectionUtils.isNotEmpty(violations)) {\n      importError.addViolations(violations);\n    }\n    return importError;\n  }\n\n  private OpenAPI loadByYaml(String yaml) {\n    SwaggerParseResult parseResult = CompatibilityCheckParser.parseYaml(yaml);\n    if (CollectionUtils.isNotEmpty(parseResult.getMessages())) {\n      throw new RuntimeException(StringUtils.join(parseResult.getMessages(), \",\"));\n    }\n    return parseResult.getOpenAPI();\n  }\n\n\n  \n  private OasDiffValidationContext createContext(OpenAPI leftOpenAPI, OpenAPI rightOpenAPI) {\n\n    OasDiffValidationContext context = new OasDiffValidationContext(leftOpenAPI, rightOpenAPI);\n    initContext(context);\n    return context;\n\n  }\n  \n  \n  private void initContext(OasDiffValidationContext context) {\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/java/org/apache/servicecomb/toolkit/oasv/web/api/controller/ImportError.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.web.api.controller;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.commons.collections4.CollectionUtils;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\n\npublic class ImportError {\n\n  private final List<String> parseErrors = new ArrayList<>();\n\n  private final List<OasViolation> violations = new ArrayList<>();\n\n  private final List<OasDiffViolation> diffViolations = new ArrayList<>();\n\n  @JsonIgnore\n  public boolean isNotEmpty() {\n    return CollectionUtils.isNotEmpty(parseErrors)\n        || CollectionUtils.isNotEmpty(violations)\n        || CollectionUtils.isNotEmpty(diffViolations);\n  }\n\n  /**\n   * OAS Spec Yaml parse error\n   *\n   * @return\n   */\n  public List<String> getParseErrors() {\n    return parseErrors;\n  }\n\n  /**\n   * check style violations\n   *\n   * @return\n   */\n  public List<OasViolation> getViolations() {\n    return violations;\n  }\n\n  /**\n   * compatibility violations\n   *\n   * @return\n   */\n  public List<OasDiffViolation> getDiffViolations() {\n    return diffViolations;\n  }\n\n  public void addParseErrors(List<String> syntaxErrors) {\n    this.parseErrors.addAll(syntaxErrors);\n  }\n\n  public void addViolations(List<OasViolation> violations) {\n    this.violations.addAll(violations);\n  }\n\n  public void addDiffViolations(List<OasDiffViolation> diffViolations) {\n    this.diffViolations.addAll(diffViolations);\n  }\n\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/java/org/apache/servicecomb/toolkit/oasv/web/api/controller/ImportError2.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.web.api.controller;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.commons.collections4.CollectionUtils;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\n\npublic class ImportError2 {\n\n  private final List<String> leftParseErrors = new ArrayList<>();\n\n  private final List<String> rightParseErrors = new ArrayList<>();\n\n  private final List<OasDiffViolation> violations = new ArrayList<>();\n\n  @JsonIgnore\n  public boolean isNotEmpty() {\n    return CollectionUtils.isNotEmpty(leftParseErrors)\n        || CollectionUtils.isNotEmpty(rightParseErrors)\n        || CollectionUtils.isNotEmpty(violations);\n  }\n\n  public List<String> getLeftParseErrors() {\n    return leftParseErrors;\n  }\n\n  public List<String> getRightParseErrors() {\n    return rightParseErrors;\n  }\n\n\n  /**\n   * compatibility violations\n   *\n   * @return\n   */\n  public List<OasDiffViolation> getViolations() {\n    return violations;\n  }\n\n  public void addLeftParseErrors(List<String> syntaxErrors) {\n    this.leftParseErrors.addAll(syntaxErrors);\n  }\n\n  public void addRightParseErrors(List<String> syntaxErrors) {\n    this.rightParseErrors.addAll(syntaxErrors);\n  }\n\n\n  public void addViolations(List<OasDiffViolation> diffViolations) {\n    this.violations.addAll(diffViolations);\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/java/org/apache/servicecomb/toolkit/oasv/web/api/controller/StyleController.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.web.api.controller;\n\nimport java.io.InputStream;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Properties;\n\nimport org.apache.commons.collections4.CollectionUtils;\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.servicecomb.toolkit.oasv.FactoryOptions;\nimport org.apache.servicecomb.toolkit.oasv.style.StyleCheckParser;\nimport org.apache.servicecomb.toolkit.oasv.util.SyntaxChecker;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasValidationContext;\nimport org.apache.servicecomb.toolkit.oasv.validation.api.OasViolation;\nimport org.apache.servicecomb.toolkit.oasv.validation.factory.OasSpecValidatorFactory;\nimport org.springframework.beans.factory.InitializingBean;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.core.io.support.PathMatchingResourcePatternResolver;\nimport org.springframework.http.HttpStatus;\nimport org.springframework.util.MimeTypeUtils;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.ResponseStatus;\nimport org.springframework.web.bind.annotation.RestController;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\n\n@RestController\n@RequestMapping(\"/api/style\")\npublic class StyleController implements InitializingBean {\n\n  @Autowired\n  private OasSpecValidatorFactory oasSpecValidatorFactory;\n\n  private FactoryOptions factoryOptions;\n\n  @PostMapping(consumes = MimeTypeUtils.TEXT_PLAIN_VALUE, produces = MimeTypeUtils.APPLICATION_JSON_VALUE)\n  @ResponseStatus(value = HttpStatus.OK)\n  public Map<String, Object> validateOpenAPI(@RequestBody String yaml) {\n\n    ImportError importError = doValidate(yaml);\n    Map<String, Object> json = new HashMap<>();\n    \n    json.put(\"acknowleged\", true);\n    json.put(\"data\", importError);\n    \n    return json;\n  }\n\n\n  private ImportError doValidate(String yaml) {\n\n    ImportError importError = new ImportError();\n    importError.addParseErrors(SyntaxChecker.check(yaml));\n    if (importError.isNotEmpty()) {\n      return importError;\n    }\n\n    SwaggerParseResult parseResult = StyleCheckParser.parseYaml(yaml);\n    if (CollectionUtils.isNotEmpty(parseResult.getMessages())) {\n      throw new RuntimeException(StringUtils.join(parseResult.getMessages(), \",\"));\n    }\n\n    OpenAPI openAPI = loadByYaml(yaml);\n    OasSpecValidator oasSpecValidator = oasSpecValidatorFactory.create(factoryOptions);\n    List<OasViolation> violations = oasSpecValidator.validate(createContext(openAPI), openAPI);\n    if (CollectionUtils.isNotEmpty(violations)) {\n      importError.addViolations(violations);\n    }\n\n    return importError;\n  }\n\n  private OpenAPI loadByYaml(String yaml) {\n    SwaggerParseResult parseResult = StyleCheckParser.parseYaml(yaml);\n    if (CollectionUtils.isNotEmpty(parseResult.getMessages())) {\n      throw new RuntimeException(StringUtils.join(parseResult.getMessages(), \",\"));\n    }\n    return parseResult.getOpenAPI();\n  }\n  \n  private OasValidationContext createContext(OpenAPI openAPI) {\n\n    OasValidationContext oasValidationContext = new OasValidationContext(openAPI);\n    initContext(oasValidationContext);\n    return oasValidationContext;\n\n  }\n  \n  \n  private void initContext(OasValidationContext context) {\n  }\n\n  @Override\n  public void afterPropertiesSet() throws Exception {\n    PathMatchingResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver();\n    try (InputStream inputStream\n        = resourceResolver.getResource(\"classpath:style-check-rules.properties\").getInputStream()) {\n      Properties properties = new Properties();\n      properties.load(inputStream);\n      this.factoryOptions = new FactoryOptions(properties);\n    }\n  }\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/java/org/apache/servicecomb/toolkit/oasv/web/config/StyleCheckValidatorsConfiguration.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.web.config;\n\nimport org.apache.servicecomb.toolkit.oasv.style.factory.ValidatorFactoryComponents;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\n\n@Configuration\n@Import(ValidatorFactoryComponents.class)\npublic class StyleCheckValidatorsConfiguration {\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/java/org/apache/servicecomb/toolkit/oasv/web/page/controller/EditorController.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.web.page.controller;\n\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\n\n@Controller\n@RequestMapping(\"/editor\")\npublic class EditorController {\n  \n  @GetMapping()\n  public String index() {\n    \n    \n    \n    return \"editor/index\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/java/org/apache/servicecomb/toolkit/oasv/web/page/controller/IndexController.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.web.page.controller;\n\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\n\n@Controller\n@RequestMapping(\"/\")\npublic class IndexController {\n  \n  @GetMapping\n  public String index() {\n    \n    return \"index\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/java/org/apache/servicecomb/toolkit/oasv/web/page/controller/ValidatorController.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.web.page.controller;\n\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\n\n@Controller\n@RequestMapping(\"/validator\")\npublic class ValidatorController {\n\n  @GetMapping()\n  public String index() {\n    \n    \n    \n    return \"validator/index\";\n  }\n\n  @GetMapping(path = \"/style\")\n  public String complianceValidator() {\n    \n    \n    \n    return \"validator/style\";\n  }\n\n  @GetMapping(path = \"/compatibility\")\n  public String compatibilityValidator() {\n    \n    \n    \n    return \"validator/compatibility\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/java/org/apache/servicecomb/toolkit/oasv/web/page/controller/ViewerController.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.oasv.web.page.controller;\n\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\n\n@Controller\n@RequestMapping(\"/viewer\")\npublic class ViewerController {\n  \n  @GetMapping()\n  public String index() {\n    \n    \n    \n    return \"viewer/index\";\n  }\n\n}\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/resources/application.properties",
    "content": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nserver.port=8080\nserver.context-path=\n\n\n#thymeleaf\n\nspring.thymeleaf.cache=false\n\n#spring.thymeleaf.prefix=classpath:/templates/\n#spring.thymeleaf.suffix=.html\n#spring.thymeleaf.check-template-location=true\n#spring.thymeleaf.encoding=UTF-8\n#spring.thymeleaf.mode=HTML5\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/resources/samples/petstore-openapi-wrong.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\nopenapi: \"3.0.0\"\ninfo:\n  version: 1.0.0\n  title: Swagger Petstore\n  license:\n    name: MIT\nservers:\n  - url: http://petstore.swagger.io/v1\npaths:\n  /pets:\n    get:\n      summary: List all pets\n      operationId: listPets\n      tags:\n        - pets\n      parameters:\n        - name: limit\n          in: query\n          description: How many items to return at one time (max 100)\n          required: false\n          schema:\n            type: integer\n            format: int32\n      responses:\n        '200':\n          description: A paged array of pets\n          headers:\n            x-next:\n              description: A link to the next page of responses\n              schema:\n                type: string\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n    post:\n      summary: Create a pet\n      operationId: createPets\n      tags:\n        - pets\n      responses:\n        '201':\n          description: Null response\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n  /pets/{petId}:\n    get:\n      summary: Info for a specific pet\n      operationId: showPetById\n      tags:\n        - pets\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          description: The id of the pet to retrieve\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Expected response to a valid request\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Pets\"\n        default:\n          description: unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    Pet:\n      required:\n        - id\n        - name\n      properties:\n        id:\n          type: integer\n          format: int64\n        name:\n          type: string\n        tag:\n          type: string\n    Pets:\n      type: array\n      items:\n        $ref: \"#/components/schemas/Pet\"\n    Error:\n      required:\n        - code\n        - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/resources/style-check-rules.properties",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n# OpenAPI Object\nopenAPI.openapi.gte=3.0.2\nopenAPI.tags.size.gte=1\nopenAPI.security.size.eq=0\n\n# Info Object\ninfo.description.required=true\n\n# Tag Object\ntag.name.case=upper-camel-case\ntag.name.must_be_referenced=true\ntag.description.required=true\n\n# Paths Object\npaths.key.case=lower-camel-case\n\n# Operation Object\noperation.summary.required=true\noperation.operationId.case=lower-camel-case\noperation.tags.size.eq=1\noperation.tags.element.must_reference_root_tags=true\noperations.servers.size.eq=0\n\n# Parameter Object\nparameter.description.required=true\nparameter.name.header.case=upper-hyphen-case\nparameter.name.cookie.case=lower-camel-case\nparameter.name.path.case=lower-camel-case\nparameter.name.query.case=lower-camel-case\n\n# RequestBody Object\nrequestBody.description.required=true\n\n# Response Object\nresponse.headers.key.case=upper-hyphen-case\n\n# Schema Object\nschema.title.required=true\nschema.properties.key.case=lower-camel-case\n\n# Encoding Object\nencoding.headers.key.case=upper-hyphen-case\n\n# Header Object\nheader.description.required=true\n\n# Components Object\ncomponents.schemas.key.case=upper-camel-case\ncomponents.responses.key.case=upper-camel-case\ncomponents.parameters.key.case=upper-camel-case\ncomponents.examples.key.case=upper-camel-case\ncomponents.requestBodies.key.case=upper-camel-case\ncomponents.headers.key.case=upper-hyphen-case\ncomponents.links.key.case=upper-hyphen-case\ncomponents.callbacks.key.case=upper-camel-case\ncomponents.headers.key.case=upper-camel-case\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/resources/templates/index.html",
    "content": "<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<!DOCTYPE html>\n\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:th=\"http://www.thymeleaf.org\" >\n<head>\n  <meta content=\"text/html;charset=UTF-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"/>\n  <title>The OpenAPI Specification Tools - Validator</title>\n\n  <link href=\"asserts/css/bootstrap.min.css\" th:href=\"@{/webjars/bootstrap/4.3.1/css/bootstrap.css}\" rel=\"stylesheet\">\n</head>\n\n<body>\n\n  <nav class=\"navbar navbar-expand-lg navbar-dark bg-dark\">\n  <!-- Navbar content -->\n    <a class=\"navbar-brand\" href=\"#\">Apache ServiceComb Toolkit OAS Validator</a>\n    <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarNav\" aria-controls=\"navbarNav\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n      <span class=\"navbar-toggler-icon\"></span>\n    </button>\n    <div class=\"collapse navbar-collapse\" id=\"navbarNav\">\n      <ul class=\"navbar-nav\">\n        <li class=\"nav-item\">\n          <a class=\"nav-link\" href=\"#\" th:href=\"@{/}\">首页</a>\n        </li>\n      </ul>\n    </div>\n  </nav>\n  \n  <div style=\"height: 50px;\"></div>\n\n  <div class=\"container\">\n  \n  \n  <div class=\"card-deck\">\n  \n  <div class=\"card mb-3 \">\n    <!-- <img src=\"...\" class=\"card-img-top\" alt=\"...\"> -->\n    <div class=\"card-body\">\n      <h5 class=\"card-title\">风格校验 &nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-size: 1rem;\">[<a href=\"https://github.com/apache/servicecomb-toolkit/blob/master/oas-validator/README.md\" target=\"_blank\">文档</a>]</span> </h5>\n      <p class=\"card-text\">对OAS Yaml文档的内容做风格校验</p>\n      <a href=\"#\" th:href=\"@{/validator/style}\" class=\"btn btn-primary\">进入</a>\n      \n    </div>\n  </div>\n  \n  <div class=\"card mb-3 \">\n    <!-- <img src=\"...\" class=\"card-img-top\" alt=\"...\"> -->\n    <div class=\"card-body\">\n      <h5 class=\"card-title\">兼容性检查 &nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-size: 1rem;\">[<a href=\"https://github.com/apache/servicecomb-toolkit/blob/master/oas-validator/README.md\" target=\"_blank\">文档</a>]</span> </h5>\n      <p class=\"card-text\">对新旧两个版本的OAS做兼容性检查。</p>\n      <a href=\"#\" th:href=\"@{/validator/compatibility}\" class=\"btn btn-primary\">进入</a>\n    </div>\n  </div>\n\n  </div>\n  \n  </div>\n\n</body>\n\n</html>\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/resources/templates/validator/compatibility.html",
    "content": "<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<!DOCTYPE html>\n\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:th=\"http://www.thymeleaf.org\" >\n<head>\n  <meta content=\"text/html;charset=UTF-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"/>\n  <title>The OpenAPI Specification Tools - Compatibility Validator</title>\n\n  <link href=\"asserts/css/bootstrap.min.css\" th:href=\"@{/webjars/bootstrap/4.3.1/css/bootstrap.css}\" rel=\"stylesheet\">\n</head>\n\n<body>\n\n  <nav class=\"navbar navbar-expand-lg navbar-dark bg-dark\">\n  <!-- Navbar content -->\n    <a class=\"navbar-brand\" href=\"#\">Apache ServiceComb Toolkit OAS Validator</a>\n    <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarNav\" aria-controls=\"navbarNav\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n      <span class=\"navbar-toggler-icon\"></span>\n    </button>\n    <div class=\"collapse navbar-collapse\" id=\"navbarNav\">\n      <ul class=\"navbar-nav\">\n        <li class=\"nav-item\">\n          <a class=\"nav-link\" href=\"#\" th:href=\"@{/}\">首页</a>\n        </li>\n      </ul>\n    </div>\n  </nav>\n  \n  <div style=\"height: 50px;\"></div>\n\n  <div class=\"container\">\n\n    <h2>兼容性检查 &nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-size: 1rem;\">[<a href=\"https://github.com/apache/servicecomb-toolkit/blob/master/oas-validator/README.md\" target=\"_blank\">文档</a>]</span> </h2>\n    <div class=\"\" style=\"height: 20px;\"></div>\n    \n    <div>\n      <textarea name=\"leftYaml\" placeholder=\"旧 OpenAPI Document（yaml）\" style=\"width: 45%; height: 480px;\"></textarea>\n      <textarea name=\"rightYaml\" placeholder=\"新 OpenAPI Document（yaml）\" style=\"width: 45%; height: 480px;\"></textarea>\n      <div>\n      <button id=\"compatibilityValidate\" class=\"btn btn-info\">兼容性检查</button>\n      </div>\n    </div>\n  \n    <div class=\"\" style=\"height: 20px;\"></div>\n  \n    <div>\n      <code id=\"compatibilityViolations\"></code>\n    </div>\n\n    <div class=\"\" style=\"height: 20px;\"></div>\n  \n  </div>\n\n  <script type=\"text/javascript\" src=\"\" th:src=\"@{/webjars/jquery/3.0.0/jquery.js}\"></script>\n  <script type=\"text/javascript\" src=\"\" th:src=\"@{/webjars/bootstrap/4.3.1/js/bootstrap.js}\"></script>\n  \n  <script type=\"text/javascript\">\n    var addParseErrors = function(element, title, parseErrors) {\n\n      if (parseErrors && parseErrors.length > 0) {\n        element.append(title + ' parse errors:');\n        element.append(\"<br/>\");\n        $.each(parseErrors, function(i) {\n          var parseError = parseErrors[i];\n          element.append(parseError);\n          element.append(\"<br/>\");\n        })\n        return false;\n      }\n      return true;\n    }\n\n  $(function(){\n    \n    $('#compatibilityValidate').on('click', function(e) {\n      var url = \"/api/compatibility\";\n  \n      var rightYaml = $('textarea[name=\"rightYaml\"]').val(); if (rightYaml==\"\") {return;}\n      var leftYaml = $('textarea[name=\"leftYaml\"]').val(); if (leftYaml==\"\") {return;}\n      \n      var data = leftYaml + \"\\n---\\n\" + rightYaml;\n      \n      post(url, data, function(json) {\n        console.log(json);\n        \n\n        if (!json.acknowleged) {\n          alert('出错了');\n        }\n        \n        var data = json.data;\n        var compatibilityViolations = $(\"#compatibilityViolations\");\n        compatibilityViolations.empty();\n\n        if (!addParseErrors(compatibilityViolations, 'Old version', data.leftParseErrors)) {\n          return;\n        }\n        if (!addParseErrors(compatibilityViolations, 'New version', data.rightParseErrors)) {\n          return;\n        }\n        var violations = data.violations;\n        \n        if (violations && violations.length == 0) {\n          alert('文档兼容');\n        }\n        \n\n        $.each(violations, function(i) {\n          var violation = violations[i];\n          \n          var leftLocationPath = \"\";\n          if (violation.leftLocation) {\n            $.each(violation.leftLocation.path, function(j) {\n              var p = violation.leftLocation.path[j];\n              leftLocationPath += p.name+'.';\n            });\n            if (leftLocationPath.length > 0) {\n            \tleftLocationPath = leftLocationPath.substring(0, leftLocationPath.length-1);\n            }\n          }\n          \n          var rightLocationPath = \"\";\n          if (violation.rightLocation) {\n            $.each(violation.rightLocation.path, function(j) {\n              var p = violation.rightLocation.path[j];\n              rightLocationPath += p.name+'.';\n            });\n            if (rightLocationPath.length > 0) {\n            \trightLocationPath = rightLocationPath.substring(0, rightLocationPath.length-1);\n            }\n          }\n\n          var errorInfo = leftLocationPath + \" -> \" + rightLocationPath + \" : \" + violation.error;\n\n          compatibilityViolations.append(errorInfo);\n          compatibilityViolations.append(\"<br/>\");\n        });\n        \n      });\n    });\n  \n  });\n  \n  function post(url, data, cb) {// application/json // text/plain\n    \n    $.ajax({\n      url: url, \n      data: data,\n      type: 'post',\n      headers: {\n        \"Accept\": \"application/json; charset=utf-8\", \n        \"Content-Type\": \"text/plain; charset=utf-8\"\n      },\n      success: function(json) {\n        cb(json);\n      }\n    });\n    \n  }\n  \n  </script>\n\n</body>\n\n</html>\n"
  },
  {
    "path": "oas-validator/oas-validator-web/src/main/resources/templates/validator/style.html",
    "content": "<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<!DOCTYPE html>\n\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:th=\"http://www.thymeleaf.org\" >\n<head>\n  <meta content=\"text/html;charset=UTF-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"/>\n  <title>The OpenAPI Specification Tools - Style Check Validator</title>\n\n  <link href=\"asserts/css/bootstrap.min.css\" th:href=\"@{/webjars/bootstrap/4.3.1/css/bootstrap.css}\" rel=\"stylesheet\">\n</head>\n\n<body>\n\n  <nav class=\"navbar navbar-expand-lg navbar-dark bg-dark\">\n  <!-- Navbar content -->\n    <a class=\"navbar-brand\" href=\"#\">Apache ServiceComb Toolkit OAS Validator</a>\n    <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarNav\" aria-controls=\"navbarNav\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n      <span class=\"navbar-toggler-icon\"></span>\n    </button>\n    <div class=\"collapse navbar-collapse\" id=\"navbarNav\">\n      <ul class=\"navbar-nav\">\n        <li class=\"nav-item\">\n          <a class=\"nav-link\" href=\"#\" th:href=\"@{/}\">首页</a>\n        </li>\n      </ul>\n    </div>\n  </nav>\n  \n  <div style=\"height: 50px;\"></div>\n\n  <div class=\"container\">\n    \n    <h2>风格校验 &nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-size: 1rem;\">[<a href=\"https://github.com/apache/servicecomb-toolkit/blob/master/oas-validator/README.md\" target=\"_blank\">文档</a>]</span> </h2>\n    <div class=\"\" style=\"height: 20px;\"></div>\n  \n    <div>\n      <textarea name=\"yaml\" placeholder=\"OpenAPI Document（yaml）\" style=\"width: 80%; height: 480px;\"></textarea>\n      <div>\n      <button id=\"styleValidate\" class=\"btn btn-info\">风格校验</button>\n      </div>\n    </div>\n    \n    <div class=\"\" style=\"height: 20px;\"></div>\n    \n    <div>\n      <code id=\"styleViolations\"></code>\n    </div>\n\n    <div class=\"\" style=\"height: 20px;\"></div>\n  \n  </div>\n  \n    \n  <script type=\"text/javascript\" src=\"\" th:src=\"@{/webjars/jquery/3.0.0/jquery.js}\"></script>\n  <script type=\"text/javascript\" src=\"\" th:src=\"@{/webjars/bootstrap/4.3.1/js/bootstrap.js}\"></script>\n  \n  <script type=\"text/javascript\">\n\n    var addParseErrors = function(element, parseErrors) {\n\n      if (parseErrors && parseErrors.length > 0) {\n        element.append(\"Parse errors:\");\n        element.append(\"<br/>\");\n        $.each(parseErrors, function(i) {\n          var parseError = parseErrors[i];\n          element.append(parseError);\n          element.append(\"<br/>\");\n        })\n        return false;\n      }\n      return true;\n    }\n\n    $(function(){\n    \n    $('#styleValidate').on('click', function(e) {\n      var url = \"/api/style\";\n      \n      var yaml = $('textarea[name=\"yaml\"]').val(); if (yaml==\"\") {return;}\n      \n      var data = yaml\n      \n      post(url, data, function(json) {\n        console.log(json);\n        \n        if (!json.acknowleged) {\n          alert('出错了');\n        }\n        \n        var data = json.data;\n\n        var styleViolations = $(\"#styleViolations\");\n        styleViolations.empty();\n\n        if (!addParseErrors(styleViolations, data.parseErrors)) {\n          return;\n        }\n\n        var violations = data.violations;\n        if (violations && violations.length == 0) {\n          alert('文档合规');\n        }\n\n        $.each(violations, function(i) {\n          var violation = violations[i];\n          \n          var locationPath = \"\";\n          $.each(violation.location.path, function(j) {\n            var p = violation.location.path[j];\n            locationPath += p.name+'.';\n          });\n          if (locationPath.length > 0) {\n          \tlocationPath = locationPath.substring(0, locationPath.length-1);\n          }\n          \n          var errorInfo = \"\"+ locationPath + \" : \" + violation.error;\n          \n          styleViolations.append(errorInfo);\n          styleViolations.append(\"<br/>\");\n        });\n        \n      });\n    });\n\n  });\n  \n  function post(url, data, cb) {// application/json // text/plain\n    \n    $.ajax({\n      url: url, \n      data: data,\n      type: 'post',\n      headers: {\n        \"Accept\": \"application/json; charset=utf-8\", \n        \"Content-Type\": \"text/plain; charset=utf-8\"\n      },\n      success: function(json) {\n        cb(json);\n      }\n    });\n    \n  }\n  \n  </script>\n  \n</body>\n\n</html>\n"
  },
  {
    "path": "oas-validator/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n  <parent>\n    <artifactId>toolkit</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>oas-validator-parent</artifactId>\n  <packaging>pom</packaging>\n  \n  <modules>\n    <module>oas-validator-core</module>\n    <module>oas-validator-core-spring</module>\n    <module>oas-validator-test</module>\n    <module>oas-validator-style</module>\n    <module>oas-validator-compatibility</module>\n    <module>oas-validator-compatibility-spring</module>\n    <module>oas-validator-web</module>\n  </modules>\n\n</project>\n"
  },
  {
    "path": "pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <parent>\n    <groupId>org.apache</groupId>\n    <artifactId>apache</artifactId>\n    <version>18</version>\n  </parent>\n\n  <groupId>org.apache.servicecomb.toolkit</groupId>\n  <artifactId>toolkit</artifactId>\n  <version>0.3.0-SNAPSHOT</version>\n  <packaging>pom</packaging>\n\n  <name>Apache ServiceComb Toolkit</name>\n  <url>https://github.com/apache/servicecomb-toolkit</url>\n\n  <properties>\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <java.version>1.8</java.version>\n    <maven.compiler.source>${java.version}</maven.compiler.source>\n    <maven.compiler.target>${java.version}</maven.compiler.target>\n    \n    <javax.ws.rs-api.version>2.1</javax.ws.rs-api.version>\n    <swagger.version>2.0.10</swagger.version>\n    <swagger-codegen.version>2.4.3</swagger-codegen.version>\n    <junit.version>4.12</junit.version>\n    <asm.version>7.2</asm.version>\n    <powermock.version>1.6.2</powermock.version>\n    <javachassis.version>1.2.0</javachassis.version>\n    <airline.version>0.7</airline.version>\n    <log4j2.version>2.3</log4j2.version>\n    <org.eclipse.jgit.version>5.3.0.201903130848-r</org.eclipse.jgit.version>\n    <mockito-core.version>2.25.0</mockito-core.version>\n    <maven-core.version>3.6.0</maven-core.version>\n    <openapi-generator.version>4.1.2</openapi-generator.version>\n    <commons-lang3.version>3.4</commons-lang3.version>\n    <maven-aether-provider.version>3.2.2</maven-aether-provider.version>\n    <swagger-parser.version>2.0.15</swagger-parser.version>\n    <commons-collections4.version>4.3</commons-collections4.version>\n    <commons-io.version>2.6</commons-io.version>\n    <spring-boot.version>2.1.4.RELEASE</spring-boot.version>\n    <fabric8.dmp.version>0.28.0</fabric8.dmp.version>\n    <maven-compat.version>3.2.2</maven-compat.version>\n    <webjars.version>4.3.1</webjars.version>\n          \n    <maven.surefire.version>3.0.0-M3</maven.surefire.version>\n    <maven-plugin-plugin.version>3.5</maven-plugin-plugin.version>\n    <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>\n    <maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>\n    <maven-resources-plugin.version>3.0.0</maven-resources-plugin.version>\n    <maven-plugin-testing-harness.version>3.3.0</maven-plugin-testing-harness.version>\n    <coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>\n    <maven-release-plugin.version>2.5.3</maven-release-plugin.version>\n    <maven-javadoc-plugin.version>2.9.1</maven-javadoc-plugin.version>\n    <maven-source-plugin.version>2.2.1</maven-source-plugin.version>\n    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>\n    <jacoco-maven-plugin.version>0.7.8</jacoco-maven-plugin.version>\n    <maven-remote-resources-plugin.version>1.6.0</maven-remote-resources-plugin.version>\n    <apache-rat-plugin.version>0.13</apache-rat-plugin.version>\n    <license-maven-plugin.version>1.19</license-maven-plugin.version>\n    <jacoco-maven-plugin.version>0.7.8</jacoco-maven-plugin.version>\n    <system-rules.version>1.19.0</system-rules.version>\n  </properties>\n\n  <licenses>\n    <license>\n      <name>Apache License, Version 2.0</name>\n      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>\n      <distribution>repo</distribution>\n    </license>\n  </licenses>\n\n  <mailingLists>\n    <mailingList>\n      <name>Development List</name>\n      <subscribe>dev-subscribe@servicecomb.apache.org</subscribe>\n      <unsubscribe>dev-unsubscribe@servicecomb.apache.org</unsubscribe>\n      <post>dev@servicecomb.apache.org</post>\n    </mailingList>\n    <mailingList>\n      <name>Commits List</name>\n      <subscribe>commits-subscribe@servicecomb.apache.org</subscribe>\n      <unsubscribe>commits-unsubscribe@servicecomb.apache.org</unsubscribe>\n      <post>commits@servicecomb.apache.org</post>\n    </mailingList>\n  </mailingLists>\n\n  <developers>\n    <developer>\n      <name>The ServiceComb Developer Team</name>\n      <email>dev@servicecomb.apache.org</email>\n    </developer>\n  </developers>\n\n  <issueManagement>\n    <system>jira</system>\n    <url>https://issues.apache.org/jira/browse/SCB</url>\n  </issueManagement>\n\n  <organization>\n    <name>The Apache Software Foundation</name>\n    <url>http://www.apache.org/</url>\n  </organization>\n\n  <inceptionYear>2019</inceptionYear>\n\n  <scm>\n    <url>https://github.com/apache/servicecomb-toolkit</url>\n    <connection>scm:git:https://github.com/apache/servicecomb-toolkit.git</connection>\n    <developerConnection>scm:git:https://github.com/apache/servicecomb-toolkit.git</developerConnection>\n    <tag>v${project.version}</tag>\n  </scm>\n\n  <distributionManagement>\n    <repository>\n      <id>apache.releases.https</id>\n      <name>Apache Release Distribution Repository</name>\n      <url>https://repository.apache.org/service/local/staging/deploy/maven2</url>\n    </repository>\n    <snapshotRepository>\n      <id>apache.snapshots.https</id>\n      <name>Apache Development Snapshot Repository</name>\n      <url>https://repository.apache.org/content/repositories/snapshots</url>\n    </snapshotRepository>\n  </distributionManagement>\n\n  <modules>\n    <module>codegen</module>\n    <module>cli</module>\n    <module>docgen</module>\n    <module>common</module>\n    <module>toolkit-maven-plugin</module>\n    <module>core</module>\n    <module>integration-tests</module>\n    <module>contractgen</module>\n    <module>oas-validator</module>\n    <module>oas-generator</module>\n  </modules>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>cli</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>codegen</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>common</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>core</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>docgen</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>contractgen</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>toolkit-maven-plugin</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>oas-validator-core</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>oas-validator-core-spring</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>oas-validator-test</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>oas-validator-style</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>oas-validator-compatibility</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>oas-validator-compatibility-spring</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>oas-generator-core</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>oas-generator-servicecomb</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>oas-generator-jaxrs</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>oas-generator-spring</artifactId>\n        <version>${project.version}</version>\n      </dependency>\n      \n      <dependency>\n        <groupId>javax.ws.rs</groupId>\n        <artifactId>javax.ws.rs-api</artifactId>\n        <version>${javax.ws.rs-api.version}</version>\n      </dependency>\n      \n      <dependency>\n        <groupId>io.swagger.core.v3</groupId>\n        <artifactId>swagger-models</artifactId>\n        <version>${swagger.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>io.swagger.core.v3</groupId>\n        <artifactId>swagger-annotations</artifactId>\n        <version>${swagger.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>io.swagger.core.v3</groupId>\n        <artifactId>swagger-core</artifactId>\n        <version>${swagger.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>junit</groupId>\n        <artifactId>junit</artifactId>\n        <version>${junit.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.ow2.asm</groupId>\n        <artifactId>asm</artifactId>\n        <version>${asm.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb</groupId>\n        <artifactId>provider-rest-common</artifactId>\n        <version>${javachassis.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.servicecomb</groupId>\n        <artifactId>provider-pojo</artifactId>\n        <version>${javachassis.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.powermock</groupId>\n        <artifactId>powermock-module-junit4</artifactId>\n        <version>${powermock.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.powermock</groupId>\n        <artifactId>powermock-api-mockito</artifactId>\n        <version>${powermock.version}</version>\n      </dependency>\n      \n      <dependency>\n        <groupId>io.airlift</groupId>\n        <artifactId>airline</artifactId>\n        <version>${airline.version}</version>\n      </dependency>\n      \n      <dependency>\n        <groupId>org.apache.logging.log4j</groupId>\n        <artifactId>log4j-slf4j-impl</artifactId>\n        <version>${log4j2.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.logging.log4j</groupId>\n        <artifactId>log4j-api</artifactId>\n        <version>${log4j2.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.logging.log4j</groupId>\n        <artifactId>log4j-core</artifactId>\n        <version>${log4j2.version}</version>\n      </dependency>\n      \n      <dependency><!-- 桥接：告诉commons logging使用Log4j2 -->\n        <groupId>org.apache.logging.log4j</groupId>\n        <artifactId>log4j-jcl</artifactId>\n        <version>${log4j2.version}</version>\n      </dependency>\n      \n      <dependency>\n        <groupId>io.swagger</groupId>\n        <artifactId>swagger-codegen</artifactId>\n        <version>${swagger-codegen.version}</version>\n      </dependency>\n      \n      <dependency>\n        <groupId>org.eclipse.jgit</groupId>\n        <artifactId>org.eclipse.jgit</artifactId>\n        <version>${org.eclipse.jgit.version}</version>\n      </dependency>\n      \n      <dependency>\n        <groupId>org.mockito</groupId>\n        <artifactId>mockito-core</artifactId>\n        <version>${mockito-core.version}</version>\n      </dependency>\n      \n      <dependency>\n        <groupId>org.apache.maven</groupId>\n        <artifactId>maven-core</artifactId>\n        <version>${maven-core.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.maven.plugin-testing</groupId>\n        <artifactId>maven-plugin-testing-harness</artifactId>\n        <version>${maven-plugin-testing-harness.version}</version>\n      </dependency>\n      \n      <dependency>\n        <groupId>org.openapitools</groupId>\n        <artifactId>openapi-generator</artifactId>\n        <version>${openapi-generator.version}</version>\n      </dependency>\n      \n      <dependency>\n        <groupId>org.apache.servicecomb</groupId>\n        <artifactId>swagger-generator-core</artifactId>\n        <version>${javachassis.version}</version>\n      </dependency>\n    \n      <dependency>\n        <groupId>org.apache.commons</groupId>\n        <artifactId>commons-lang3</artifactId>\n        <version>${commons-lang3.version}</version>\n      </dependency>\n      \n      <dependency>\n        <groupId>org.apache.maven</groupId>\n        <artifactId>maven-plugin-api</artifactId>\n        <version>${maven-core.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.maven.plugin-tools</groupId>\n        <artifactId>maven-plugin-annotations</artifactId>\n        <version>${maven-core.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.maven.plugin-tools</groupId>\n        <artifactId>maven-plugin-tools-annotations</artifactId>\n        <version>${maven-core.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.maven</groupId>\n        <artifactId>maven-aether-provider</artifactId>\n        <version>${maven-aether-provider.version}</version>\n      </dependency>\n      \n      <dependency>\n        <groupId>org.apache.maven</groupId>\n        <artifactId>maven-compat</artifactId>\n        <version>${maven-compat.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-dependencies</artifactId>\n        <version>${spring-boot.version}</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n\n      <dependency>\n        <groupId>org.apache.commons</groupId>\n        <artifactId>commons-collections4</artifactId>\n        <version>${commons-collections4.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>io.swagger.parser.v3</groupId>\n        <artifactId>swagger-parser</artifactId>\n        <version>${swagger-parser.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>commons-io</groupId>\n        <artifactId>commons-io</artifactId>\n        <version>${commons-io.version}</version>\n      </dependency>\n      \n      <dependency>\n        <groupId>org.webjars</groupId>\n        <artifactId>bootstrap</artifactId>\n        <version>${webjars.version}</version>\n      </dependency>\n\n      <dependency>\n        <groupId>com.github.stefanbirkner</groupId>\n        <artifactId>system-rules</artifactId>\n        <version>${system-rules.version}</version>\n        <scope>test</scope>\n      </dependency>\n      \n    </dependencies>\n  </dependencyManagement>\n\n  <build>\n    <pluginManagement>\n      <plugins>\n        <plugin>\n          <groupId>org.eluder.coveralls</groupId>\n          <artifactId>coveralls-maven-plugin</artifactId>\n          <version>${coveralls-maven-plugin.version}</version>\n\n          <configuration>\n            <jacocoReports>\n              <jacocoReport>\n                ${project.basedir}/integration-tests/coverage-aggregate/target/site/jacoco-aggregate/jacoco.xml\n              </jacocoReport>\n            </jacocoReports>\n          </configuration>\n        </plugin>\n\n        <plugin>\n          <groupId>org.jacoco</groupId>\n          <artifactId>jacoco-maven-plugin</artifactId>\n          <version>${jacoco-maven-plugin.version}</version>\n          <executions>\n            <execution>\n              <id>default-prepare-agent</id>\n              <goals>\n                <goal>prepare-agent</goal>\n              </goals>\n              <configuration>\n                <destFile>${project.build.directory}/jacoco.exec</destFile>\n              </configuration>\n            </execution>\n            <execution>\n              <id>default-prepare-agent-integration</id>\n              <phase>pre-integration-test</phase>\n              <goals>\n                <goal>prepare-agent-integration</goal>\n              </goals>\n              <configuration>\n                <destFile>${project.build.directory}/jacoco-it.exec</destFile>\n                <propertyName>jacoco.failsafe.argLine</propertyName>\n              </configuration>\n            </execution>\n            <execution>\n              <id>default-report</id>\n              <goals>\n                <goal>report</goal>\n              </goals>\n            </execution>\n            <execution>\n              <id>default-report-integration</id>\n              <goals>\n                <goal>report-integration</goal>\n              </goals>\n            </execution>\n          </executions>\n        </plugin>\n        <plugin>\n          <groupId>org.apache.maven.plugins</groupId>\n          <artifactId>maven-compiler-plugin</artifactId>\n          <version>${maven-compiler-plugin.version}</version>\n        </plugin>\n        <plugin>\n          <groupId>org.apache.maven.plugins</groupId>\n          <artifactId>maven-resources-plugin</artifactId>\n          <version>${maven-resources-plugin.version}</version>\n          <configuration>\n            <encoding>UTF-8</encoding>\n          </configuration>\n        </plugin>\n        <plugin>\n          <groupId>org.springframework.boot</groupId>\n          <artifactId>spring-boot-maven-plugin</artifactId>\n          <version>${spring-boot.version}</version>\n        </plugin>\n        <plugin>\n          <groupId>org.apache.maven.plugins</groupId>\n          <artifactId>maven-deploy-plugin</artifactId>\n          <version>${maven-deploy-plugin.version}</version>\n        </plugin>\n        <plugin>\n          <groupId>org.apache.maven.plugins</groupId>\n          <artifactId>maven-plugin-plugin</artifactId>\n          <version>${maven-plugin-plugin.version}</version>\n        </plugin>\n        \n        <plugin>\n          <groupId>org.apache.maven.plugins</groupId>\n          <artifactId>maven-surefire-plugin</artifactId>\n          <version>${maven.surefire.version}</version>\n        </plugin>\n\n        <plugin>\n          <groupId>org.apache.maven.plugins</groupId>\n          <artifactId>maven-surefire-report-plugin</artifactId>\n          <version>${maven.surefire.version}</version>\n          <executions>\n            <execution>\n              <id>report</id>\n              <phase>post-integration-test</phase>\n              <goals>\n                <goal>report-only</goal>\n              </goals>\n            </execution>\n          </executions>\n        </plugin>\n        \n      </plugins>\n    </pluginManagement>\n\n\n    <plugins>\n      <plugin>\n        <groupId>org.codehaus.mojo</groupId>\n        <artifactId>license-maven-plugin</artifactId>\n        <version>${license-maven-plugin.version}</version>\n        <executions>\n          <execution>\n            <id>default-cli</id>\n            <configuration>\n              <!-- Accept the pom module -->\n              <acceptPomPackaging>true</acceptPomPackaging>\n              <!-- Using the template which is grouped by License file -->\n              <fileTemplate>/org/codehaus/mojo/license/third-party-file-groupByMultiLicense.ftl</fileTemplate>\n              <licenseMerges>\n                <licenseMerge>The Apache Software License, Version 2.0|The Apache License, Version 2.0</licenseMerge>\n                <licenseMerge>The Apache Software License, Version 2.0|Apache License, Version 2.0</licenseMerge>\n                <licenseMerge>The Apache Software License, Version 2.0|Apache Public License 2.0</licenseMerge>\n                <licenseMerge>The Apache Software License, Version 2.0|Apache 2</licenseMerge>\n                <licenseMerge>The Apache Software License, Version 2.0|Apache 2.0</licenseMerge>\n                <licenseMerge>The Apache Software License, Version 2.0|Apache-2.0</licenseMerge>\n                <licenseMerge>The Apache Software License, Version 2.0|Apache License 2.0</licenseMerge>\n                <licenseMerge>The Apache Software License, Version 2.0|Apache License, version 2.0</licenseMerge>\n                <licenseMerge>3-Clause BSD License|BSD 3-clause</licenseMerge>\n                <licenseMerge>3-Clause BSD License|BSD 3-Clause</licenseMerge>\n                <licenseMerge>Eclipse Public License v1.0|Eclipse Public License 1.0</licenseMerge>\n                <licenseMerge>Eclipse Public License v1.0|Eclipse Public License - v 1.0</licenseMerge>\n                <licenseMerge>The MIT License|MIT License</licenseMerge>\n              </licenseMerges>\n            </configuration>\n          </execution>\n        </executions>\n      </plugin>\n      <plugin>\n        <groupId>org.apache.rat</groupId>\n        <artifactId>apache-rat-plugin</artifactId>\n        <version>${apache-rat-plugin.version}</version>\n        <configuration>\n          <excludes>\n            <exclude>DISCLAIMER</exclude>\n            <exclude>.travis.yml</exclude>\n            <exclude>**/*.md</exclude>\n            <excldue>**/*.MD</excldue>\n            <exclude>**/target/*</exclude>\n            <exclude>**/target/**/*</exclude>\n            <!-- Skip the code style configuration file -->\n            <exclude>**/etc/eclipse-java-google-style.xml</exclude>\n            <exclude>**/etc/intellij-java-google-style.xml</exclude>\n            <!-- Skip the ssl configuration files -->\n            <exculde>**/resources/ssl/**</exculde>\n            <!-- SKip the licenses files -->\n            <exclude>**/release/licenses/**</exclude>\n            <!-- Skip the demo log files -->\n            <exclude>**/logs/**.log</exclude>\n            <exclude>**/**.log</exclude>\n            <!-- Skip the IDE file -->\n            <exclude>**/**.iml</exclude>\n            <!-- Skip web resource files -->\n            <exclude>**/images/*.png</exclude>\n            <exclude>**/images/*.jpg</exclude>\n            <!-- Skip template files -->\n            <exclude>**/**.mustache</exclude>\n            <!-- Skip test template files -->\n            <exclude>**/src/test/resources/**/*.yaml</exclude>\n            <exclude>**/src/test/resources/**/*.json</exclude>\n          </excludes>\n        </configuration>\n      </plugin>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-remote-resources-plugin</artifactId>\n        <version>${maven-remote-resources-plugin.version}</version>\n        <executions>\n          <execution>\n            <id>process-resource-bundles</id>\n            <goals>\n              <goal>process</goal>\n            </goals>\n            <configuration>\n              <resourceBundles>\n                <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>\n              </resourceBundles>\n              <properties>\n                <projectName>Apache ServiceComb</projectName>\n              </properties>\n            </configuration>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n\n  <profiles>\n    <profile>\n      <id>jacoco</id>\n      <build>\n        <plugins>\n          <plugin>\n            <groupId>org.jacoco</groupId>\n            <artifactId>jacoco-maven-plugin</artifactId>\n          </plugin>\n        </plugins>\n      </build>\n    </profile>\n    <profile>\n      <id>release</id>\n      <modules>\n        <module>toolkit-distribution</module>\n      </modules>\n      <build>\n        <plugins>\n          <plugin>\n            <groupId>org.apache.maven.plugins</groupId>\n            <artifactId>maven-deploy-plugin</artifactId>\n          </plugin>\n          <plugin>\n            <groupId>org.apache.maven.plugins</groupId>\n            <artifactId>maven-gpg-plugin</artifactId>\n            <version>${maven-gpg-plugin.version}</version>\n            <executions>\n              <execution>\n                <id>sign-artifacts</id>\n                <phase>verify</phase>\n                <goals>\n                  <goal>sign</goal>\n                </goals>\n              </execution>\n            </executions>\n          </plugin>\n          <plugin>\n            <groupId>org.apache.maven.plugins</groupId>\n            <artifactId>maven-source-plugin</artifactId>\n            <version>${maven-source-plugin.version}</version>\n            <executions>\n              <execution>\n                <id>attach-sources</id>\n                <goals>\n                  <goal>jar-no-fork</goal>\n                </goals>\n              </execution>\n            </executions>\n          </plugin>\n          <plugin>\n            <groupId>org.apache.maven.plugins</groupId>\n            <artifactId>maven-javadoc-plugin</artifactId>\n            <version>${maven-javadoc-plugin.version}</version>\n            <executions>\n              <execution>\n                <id>attach-javadocs</id>\n                <goals>\n                  <goal>jar</goal>\n                </goals>\n              </execution>\n            </executions>\n          </plugin>\n          <plugin>\n            <groupId>org.apache.maven.plugins</groupId>\n            <artifactId>maven-release-plugin</artifactId>\n            <version>${maven-release-plugin.version}</version>\n            <configuration>\n              <autoVersionSubmodules>true</autoVersionSubmodules>\n              <useReleaseProfile>false</useReleaseProfile>\n              <releaseProfiles>release</releaseProfiles>\n              <goals>deploy</goals>\n            </configuration>\n          </plugin>\n        </plugins>\n      </build>\n    </profile>\n  </profiles>\n\n</project>\n"
  },
  {
    "path": "samples/README-ZH.md",
    "content": "# samples | [English](./README.md)\n\n以下是ServiceComb Toolkit的一些使用案例\n1. 基于SpringMvc实现的遗留应用自动转换为基于ServiceComb的微服务工程。请参考以下示例   \n   [generate-from-code-sample](./generate-from-code-sample/README-ZH.md)\n2. 基于OpenAPI契约文件自动生成基于ServiceComb的微服务工程。请参考以下示例   \n[generate-from-contract-sample](./generate-from-contract-sample/README-ZH.md)\n3. 校验当前项目的API实现代码与契约文件描述是否一致。请参考以下示例  \n[verify-with-code-sample](./verify-with-code-sample/README-ZH.md)"
  },
  {
    "path": "samples/README.md",
    "content": "# samples | [中文](./README-ZH.md)\n\nIt's the samples of ServiceComb Toolkit\n1. Legacy applications based on SpringMvc are automatically converted to ServiceComb-based microservice engineering. Please refer to the following sample   \n   [generate-from-code-sample](./generate-from-code-sample)\n2. Automatic generation of ServiceComb-based microservice engineering based on OpenAPI contract file. Please refer to the following sample   \n[generate-from-contract-sample](./generate-from-contract-sample)\n3. Verify that the current project's API implementation code is consistent with the contract file description. Please refer to the following sample  \n[verify-with-code-sample](./verify-with-code-sample)"
  },
  {
    "path": "samples/generate-from-code-sample/GoodbyeService/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>generate-from-code-sample</artifactId>\n    <groupId>org.apache.servicecom.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>GoodbyeService</artifactId>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-web</artifactId>\n    </dependency>\n  </dependencies>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-dependencies</artifactId>\n        <version>1.5.12.RELEASE</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n\n</project>"
  },
  {
    "path": "samples/generate-from-code-sample/GoodbyeService/src/main/java/org/apache/servicecomb/toolkit/goodbye/GoodbyeApplication.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.goodbye;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\npublic class GoodbyeApplication {\n\n  public static void main(String[] args) {\n    SpringApplication.run(GoodbyeApplication.class,args);\n  }\n\n}\n"
  },
  {
    "path": "samples/generate-from-code-sample/GoodbyeService/src/main/java/org/apache/servicecomb/toolkit/goodbye/GoodbyeController.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.goodbye;\n\nimport javax.servlet.http.Part;\n\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestPart;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\n@RestController\npublic class GoodbyeController {\n\n  @GetMapping(\"/goodbye/{name}\")\n  public String sayGoodbye(@PathVariable(\"name\") String name, @RequestPart MultipartFile file, @RequestPart Part part) {\n    return \"Goodbye,\" + name;\n  }\n}\n"
  },
  {
    "path": "samples/generate-from-code-sample/GoodbyeService/src/main/resources/application.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\nserver:\n  port: 8080"
  },
  {
    "path": "samples/generate-from-code-sample/HelloService/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>generate-from-code-sample</artifactId>\n    <groupId>org.apache.servicecom.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>HelloService</artifactId>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-web</artifactId>\n    </dependency>\n  </dependencies>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-dependencies</artifactId>\n        <version>1.5.12.RELEASE</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n</project>"
  },
  {
    "path": "samples/generate-from-code-sample/HelloService/src/main/java/org/apache/servicecomb/toolkit/hello/HelloApplication.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.hello;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\npublic class HelloApplication {\n\n  public static void main(String[] args) {\n    SpringApplication.run(HelloApplication.class,args);\n  }\n\n}\n"
  },
  {
    "path": "samples/generate-from-code-sample/HelloService/src/main/java/org/apache/servicecomb/toolkit/hello/HelloController.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.hello;\n\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RestController;\n\n@RestController\npublic class HelloController {\n\n  @GetMapping(\"/hello/{name}\")\n  public String sayHello(@PathVariable(\"name\") String name) {\n    return \"Hello,\" + name;\n  }\n}\n"
  },
  {
    "path": "samples/generate-from-code-sample/HelloService/src/main/resources/application.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\nserver:\n  port: 8081"
  },
  {
    "path": "samples/generate-from-code-sample/README-ZH.md",
    "content": "### Generate From Code Sample\n本案例模拟一个多模块项目，包括以下两个服务：\n* HelloService\n* GoodbyeService\n\nHelloService和GoodbyeService各提供一个接口，本案例将分别将其转换成对应的基于ServiceComb java-chassis的微服务项目\n\n### 运行环境\n1. [JDK 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)\n2. [Maven 3.x](https://maven.apache.org/install.html)\n\n### 步骤1： 配置插件\n在示例项目根目录的pom.xml文件中，新增toolkit-maven-plugin插件的配置，如下\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- 输入源。设置为 code，表示解析当前代码；设置为 contract，表示解析指定目录的契约文件。不设置则默认为 code -->\n        <sourceType>code</sourceType>\n        <!-- 生成契约文件、文档的根目录，不设置则默认为运行命令所在目录下的 target 目录，生成的微服务工程在 project 目录，契约文件在 contract 目录，文档在 document 目录 -->\n        <outputDirectory>./target</outputDirectory>\n        <!-- 生成的微服务代码工程配置 -->\n        <service>\n            <!-- 微服务的类型，可生成 provider/consumer/all，默认值为 all -->\n            <serviceType>all</serviceType>\n            <groupId>org.apache.servicecom.toolkit</groupId>\n            <artifactId>generate-from-code-sample</artifactId>\n        </service>\n    </configuration>\n</plugin>\n```\n\n### 步骤2：执行插件\n在命令行中执行如下的maven命令：\n```\nmvn toolkit:generate\n```\n\n### 步骤3：输出结果\n转换的结果在generate-from-code-sample的target目录下，分别输出契约，文档和基于ServiceComb java-chassis的微服务项目\n```\ntarget/\n├── contract\n│   ├── GoodbyeService\n│   │   └── GoodbyeController.yaml\n│   └── HelloService\n│       └── HelloController.yaml\n├── document\n│   ├── GoodbyeService\n│   │   └── GoodbyeController.html\n│   └── HelloService\n│       └── HelloController.html\n└── project\n    ├── GoodbyeService-consumer\n    │   ├── pom.xml\n    │   └── src\n    ├── GoodbyeService-model\n    │   └── pom.xml\n    ├── GoodbyeService-provider\n    │   ├── pom.xml\n    │   └── src\n    ├── HelloService-consumer\n    │   ├── pom.xml\n    │   └── src\n    ├── HelloService-model\n    │   └── pom.xml\n    ├── HelloService-provider\n    │   ├── pom.xml\n    │   └── src\n    └── pom.xml\n```"
  },
  {
    "path": "samples/generate-from-code-sample/README.md",
    "content": "### Generate From Code Sample\nThis case simulates a multi-module project that includes the following two services：\n* HelloService\n* GoodbyeService\n\nHelloService and GoodbyeService each provide an API interface. This case will convert them into corresponding microservices based on ServiceComb java-chassis.\n\n### Prerequisites\nYou will need:\n1. [JDK 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)\n2. [Maven 3.x](https://maven.apache.org/install.html)\n\n### Step1: Configure plugin\nIn the pom.xml file in the root directory of the current sample project, add the configuration of the toolkit-maven-plugin plugin as follows.\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- Set to 'code' to resolve the current project. Set to 'contract' to resolve the contract file for the specified path.If not set, the default is 'code' -->\n        <sourceType>code</sourceType>\n        <!-- The root directory to save contract file and document. If it is not set, the default is the 'target' under the directory where the command is run -->\n        <outputDirectory>./target</outputDirectory>\n        <!-- Generated microservice project configuration -->\n        <service>\n            <!-- Microservice type,can generated 'provider/consumer/all',the default is 'all' -->\n            <serviceType>all</serviceType>\n            <groupId>org.apache.servicecom.toolkit</groupId>\n            <artifactId>generate-from-code-sample</artifactId>\n        </service>\n    </configuration>\n</plugin>\n```\n\n### Step2: Running Demo\nExecute the following maven command on the command line\n```\nmvn toolkit:generate\n```\n\n### Step3: Output Result\nThe result of the conversion is in the target directory of generate-from-code-sample, which respectively outputs the contract, the document and the microservice project based on ServiceComb java-chassis.\n```\ntarget/\n├── contract\n│   ├── GoodbyeService\n│   │   └── GoodbyeController.yaml\n│   └── HelloService\n│       └── HelloController.yaml\n├── document\n│   ├── GoodbyeService\n│   │   └── GoodbyeController.html\n│   └── HelloService\n│       └── HelloController.html\n└── project\n    ├── GoodbyeService-consumer\n    │   ├── pom.xml\n    │   └── src\n    ├── GoodbyeService-model\n    │   └── pom.xml\n    ├── GoodbyeService-provider\n    │   ├── pom.xml\n    │   └── src\n    ├── HelloService-consumer\n    │   ├── pom.xml\n    │   └── src\n    ├── HelloService-model\n    │   └── pom.xml\n    ├── HelloService-provider\n    │   ├── pom.xml\n    │   └── src\n    └── pom.xml\n```"
  },
  {
    "path": "samples/generate-from-code-sample/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n\n  <groupId>org.apache.servicecom.toolkit</groupId>\n  <artifactId>generate-from-code-sample</artifactId>\n  <version>0.3.0-SNAPSHOT</version>\n  <modules>\n    <module>HelloService</module>\n    <module>GoodbyeService</module>\n  </modules>\n  <packaging>pom</packaging>\n\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>toolkit-maven-plugin</artifactId>\n        <version>0.3.0-SNAPSHOT</version>\n        <configuration>\n          <!-- Set to 'code' to resolve the current project. Set to 'contract' to resolve the contract file for the specified path.If not set, the default is 'code' -->\n          <sourceType>code</sourceType>\n          <!-- The root directory to save contract file and document. If it is not set, the default is the 'target' under the directory where the command is run -->\n          <outputDirectory>./target</outputDirectory>\n          <!-- Generated microservice project configuration -->\n          <service>\n            <!-- Microservice type,can generated 'provider/consumer/all',the default is 'all' -->\n            <serviceType>all</serviceType>\n            <groupId>org.apache.servicecom.toolkit</groupId>\n            <artifactId>generate-from-code-sample</artifactId>\n          </service>\n        </configuration>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "samples/generate-from-contract-sample/README-ZH.md",
    "content": "### Generate From Contract Sample\n本案例模拟一个空项目，在该项目根目录的contract目录放置了契约  \n本案例将根据contract目录的契约生成对应的基于ServiceComb java-chassis的微服务项目\n\n### 运行环境\n1. [JDK 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)\n2. [Maven 3.x](https://maven.apache.org/install.html)\n\n### 步骤1： 配置插件\n在示例项目根目录的pom.xml文件中，新增toolkit-maven-plugin插件的配置，如下\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- 输入源。设置为 code，表示解析当前代码；设置为 contract，表示解析指定目录的契约文件。不设置则默认为 code -->\n        <sourceType>contract</sourceType>\n        <!-- 被解析的契约文件路径，在 sourceType 设置为 contract 时有效，且必须设置 -->\n        <contractLocation>./contract</contractLocation>\n        <!-- 生成契约文件、文档的根目录，不设置则默认为运行命令所在目录下的 target 目录，生成的微服务工程在 project 目录，契约文件在 contract 目录，文档在 document 目录 -->\n        <outputDirectory>./target</outputDirectory>\n        <!-- 生成的微服务代码工程配置 -->\n        <service>\n            <!-- 微服务的类型，可生成 provider/consumer/all，默认值为 all -->\n            <serviceType>provider</serviceType>\n        </service>\n    </configuration>\n</plugin>\n\n```\n\n### 步骤2：执行插件\n在命令行中执行如下的maven命令：\n```\nmvn toolkit:generate\n```\n\n### 步骤3：输出结果\n生成的内容在generate-from-code-sample的target目录下，分别输出文档和基于ServiceComb java-chassis的微服务项目\n```\ntarget/\n├── document\n│   ├── GoodByeService\n│   │   └── GoodbyeController.html\n│   └── HelloService\n│       └── HelloController.html\n└── project\n    ├── GoodByeService-model\n    │   └── pom.xml\n    ├── GoodByeService-provider\n    │   ├── pom.xml\n    │   └── src\n    ├── HelloService-model\n    │   └── pom.xml\n    ├── HelloService-provider\n    │   ├── pom.xml\n    │   └── src\n    └── pom.xml\n```"
  },
  {
    "path": "samples/generate-from-contract-sample/README.md",
    "content": "### Generate From Contract Sample\nThis case simulates an empty project, and the contracts are placed in the contract directory of the project root directory.  \nThis case will generate a ServiceComb java-chassis based microservice project based on the contracts in the contract directory.\n\n### Prerequisites\nYou will need:\n1. [JDK 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)\n2. [Maven 3.x](https://maven.apache.org/install.html)\n\n### Step1: Configure plugin\nIn the pom.xml file in the root directory of the current sample project, add the configuration of the toolkit-maven-plugin plugin as follows.\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- Set to 'code' to resolve the current project. Set to 'contract' to resolve the contract file for the specified path.If not set, the default is 'code' -->\n        <sourceType>contract</sourceType>\n        <!-- The root directory to save contract file and document. If it is not set, the default is the 'target' under the directory where the command is run -->\n        <outputDirectory>./target</outputDirectory>\n        <!-- Input contract file path. Valid when sourceType is set to 'contract', must be set -->\n        <contractLocation>./contract</contractLocation>\n        <!-- Generated microservice project configuration -->\n        <service>\n            <!-- Microservice type,can generated 'provider/consumer/all',the default is 'all' -->\n            <serviceType>provider</serviceType>\n        </service>\n    </configuration>\n</plugin>\n\n```\n\n### Step2: Running Demo\nExecute the following maven command on the command line\n```\nmvn toolkit:generate\n```\n\n### Step3: Output Result\nThe generated content is in the target directory of generate-from-code-sample, including the document and the ServiceComb java-chassis-based microservice project.\n```\ntarget/\n├── document\n│   ├── GoodByeService\n│   │   └── GoodbyeController.html\n│   └── HelloService\n│       └── HelloController.html\n└── project\n    ├── GoodByeService-model\n    │   └── pom.xml\n    ├── GoodByeService-provider\n    │   ├── pom.xml\n    │   └── src\n    ├── HelloService-model\n    │   └── pom.xml\n    ├── HelloService-provider\n    │   ├── pom.xml\n    │   └── src\n    └── pom.xml\n```"
  },
  {
    "path": "samples/generate-from-contract-sample/contract/GoodByeService/GoodbyeController.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n---\nswagger: \"2.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"swagger definition for org.apache.servicecomb.toolkit.goodbye.GoodbyeController\"\n  x-java-interface: \"gen.swagger.GoodbyeControllerIntf\"\nbasePath: \"/\"\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\npaths:\n  /goodbye/{name}:\n    get:\n      operationId: \"sayGoodbye\"\n      parameters:\n      - name: \"name\"\n        in: \"path\"\n        required: true\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n"
  },
  {
    "path": "samples/generate-from-contract-sample/contract/HelloService/HelloController.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n---\nswagger: \"2.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"swagger definition for org.apache.servicecomb.toolkit.hello.HelloController\"\n  x-java-interface: \"gen.swagger.HelloControllerIntf\"\nbasePath: \"/\"\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\npaths:\n  /hello/{name}:\n    get:\n      operationId: \"sayHello\"\n      parameters:\n      - name: \"name\"\n        in: \"path\"\n        required: true\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n"
  },
  {
    "path": "samples/generate-from-contract-sample/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>samples</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n  <packaging>pom</packaging>\n\n  <artifactId>generate-from-contract-sample</artifactId>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>toolkit-maven-plugin</artifactId>\n        <version>0.3.0-SNAPSHOT</version>\n        <configuration>\n          <!-- Set to 'code' to resolve the current project. Set to 'contract' to resolve the contract file for the specified path.If not set, the default is 'code' -->\n          <sourceType>contract</sourceType>\n          <!-- The root directory to save contract file and document. If it is not set, the default is the 'target' under the directory where the command is run -->\n          <outputDirectory>./target</outputDirectory>\n          <!-- Input contract file path. Valid when sourceType is set to 'contract', must be set -->\n          <contractLocation>./contract</contractLocation>\n          <!-- Generated microservice project configuration -->\n          <service>\n            <!-- Microservice type,can generated 'provider/consumer/all',the default is 'all' -->\n            <serviceType>provider</serviceType>\n          </service>\n        </configuration>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "samples/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n\n  <parent>\n    <artifactId>toolkit</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n  <artifactId>samples</artifactId>\n  <packaging>pom</packaging>\n  <modules>\n    <module>generate-from-code-sample</module>\n    <module>generate-from-contract-sample</module>\n    <module>verify-with-code-sample</module>\n  </modules>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-deploy-plugin</artifactId>\n        <version>2.8.2</version>\n        <configuration>\n          <skip>true</skip>\n        </configuration>\n      </plugin>\n    </plugins>\n  </build>\n\n</project>"
  },
  {
    "path": "samples/verify-with-code-sample/GreetingService/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>verify-with-code-sample</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>GreetingService</artifactId>\n    <dependencies>\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter-web</artifactId>\n    </dependency>\n  </dependencies>\n\n  <dependencyManagement>\n    <dependencies>\n      <dependency>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-dependencies</artifactId>\n        <version>1.5.12.RELEASE</version>\n        <type>pom</type>\n        <scope>import</scope>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n\n</project>"
  },
  {
    "path": "samples/verify-with-code-sample/GreetingService/src/main/java/org/apache/servicecomb/toolkit/goodbye/GreetingController.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.goodbye;\n\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RestController;\n\n@RestController\npublic class GreetingController {\n\n  @GetMapping(\"/hello/{name}\")\n  public String sayHello(@PathVariable(\"name\") String name) {\n    return \"Hello,\" + name;\n  }\n}\n"
  },
  {
    "path": "samples/verify-with-code-sample/GreetingService/src/main/java/org/apache/servicecomb/toolkit/goodbye/GreetingService.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.goodbye;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\npublic class GreetingService {\n\n  public static void main(String[] args) {\n    SpringApplication.run(GreetingService.class,args);\n  }\n\n}\n"
  },
  {
    "path": "samples/verify-with-code-sample/README-ZH.md",
    "content": "### Verify With Code Sample\n本案例包括以下服务和一个存放标准契约的contract目录\n* GreetingService  \n本案例将使用标准契约校验当前项目的契约并输出校验结果到控制台\n\n### 运行环境\n1. [JDK 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)\n2. [Maven 3.x](https://maven.apache.org/install.html)\n\n### 步骤1： 配置插件\n在示例项目根目录的pom.xml文件中，新增toolkit-maven-plugin插件的配置，如下\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- 输入源。设置为 code，表示解析当前代码；设置为 contract，表示解析指定目录的契约文件。不设置则默认为 code -->\n        <sourceType>code</sourceType>\n        <!-- 样本契约文件目录，必须设置 -->\n        <destinationContractPath>./contract</destinationContractPath>\n    </configuration>\n</plugin>\n```\n\n### 步骤2：执行插件\n在命令行中执行如下的maven命令：\n```\nmvn toolkit:verify\n```\n\n### 步骤3：输出结果\n校验的结果直接在控制台上输出\n```\n[INFO] Contract is not matched, difference is as follows\n[INFO] ./contract/GreetingController.yaml vs /opt/sunlisen/workspace/servicecomb-toolkit/samples/verify-with-code-sample/target/tmp-contract/2244468406394280775/GreetingController.yaml\n@@ -1,20 +1,3 @@\n1    -## ---------------------------------------------------------------------------                     \n2    -## Licensed to the Apache Software Foundation (ASF) under one or more                              \n3    -## contributor license agreements.  See the NOTICE file distributed with                           \n4    -## this work for additional information regarding copyright ownership.                             \n5    -## The ASF licenses this file to You under the Apache License, Version 2.0                         \n6    -## (the \"License\"); you may not use this file except in compliance with                            \n7    -## the License.  You may obtain a copy of the License at                                           \n8    -##                                                                                                 \n9    -##      http://www.apache.org/licenses/LICENSE-2.0                                                 \n10   -##                                                                                                 \n11   -## Unless required by applicable law or agreed to in writing, software                             \n12   -## distributed under the License is distributed on an \"AS IS\" BASIS,                               \n13   -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.                        \n14   -## See the License for the specific language governing permissions and                             \n15   -## limitations under the License.                                                                  \n16   -## ---------------------------------------------------------------------------                     \n17   -                                                                                                   \n18    ---                                                                                                1     ---\n19    swagger: \"2.0\"                                                                                     2     swagger: \"2.0\"\n20    info:                                                                                              3     info:\n\nthis is end of compare\n```"
  },
  {
    "path": "samples/verify-with-code-sample/README.md",
    "content": "### Verify With Code Sample\nThis case simulates a multi-module project that includes one of the following services and a contract directory that holds standard contracts.  \nThis case will use the standard contract to verify the contract of the current project and output the verification result to the console\n\n### Prerequisites\nYou will need:\n1. [JDK 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)\n2. [Maven 3.x](https://maven.apache.org/install.html)\n\n### Step1: Configure plugin\nIn the pom.xml file in the root directory of the current sample project, add the configuration of the toolkit-maven-plugin plugin as follows.\n```xml\n<plugin>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit-maven-plugin</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n    <configuration>\n        <!-- Set to 'code' to resolve the current project. Set to 'contract' to resolve the contract file for the specified path.If not set, the default is 'code' -->\n        <sourceType>code</sourceType>\n        <!-- Sample contract file path, must be set -->\n        <destinationContractPath>./contract</destinationContractPath>\n    </configuration>\n</plugin>\n```\n\n### Step2: Running Demo\nExecute the following maven command on the command line\n```\nmvn toolkit:verify\n```\n\n### Step3: Output Result\nThe result of the verification is output directly on the console\n```\n[INFO] Contract is not matched, difference is as follows\n[INFO] ./contract/GreetingController.yaml vs /opt/sunlisen/workspace/servicecomb-toolkit/samples/verify-with-code-sample/target/tmp-contract/2244468406394280775/GreetingController.yaml\n@@ -1,20 +1,3 @@\n1    -## ---------------------------------------------------------------------------                     \n2    -## Licensed to the Apache Software Foundation (ASF) under one or more                              \n3    -## contributor license agreements.  See the NOTICE file distributed with                           \n4    -## this work for additional information regarding copyright ownership.                             \n5    -## The ASF licenses this file to You under the Apache License, Version 2.0                         \n6    -## (the \"License\"); you may not use this file except in compliance with                            \n7    -## the License.  You may obtain a copy of the License at                                           \n8    -##                                                                                                 \n9    -##      http://www.apache.org/licenses/LICENSE-2.0                                                 \n10   -##                                                                                                 \n11   -## Unless required by applicable law or agreed to in writing, software                             \n12   -## distributed under the License is distributed on an \"AS IS\" BASIS,                               \n13   -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.                        \n14   -## See the License for the specific language governing permissions and                             \n15   -## limitations under the License.                                                                  \n16   -## ---------------------------------------------------------------------------                     \n17   -                                                                                                   \n18    ---                                                                                                1     ---\n19    swagger: \"2.0\"                                                                                     2     swagger: \"2.0\"\n20    info:                                                                                              3     info:\n\nthis is end of compare\n```"
  },
  {
    "path": "samples/verify-with-code-sample/contract/GreetingService/GreetingController.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n---\nswagger: \"2.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"swagger definition for org.apache.servicecomb.toolkit.goodbye.GreetingController\"\n  x-java-interface: \"gen.swagger.GreetingControllerIntf\"\nbasePath: \"/\"\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\npaths:\n  /hello/{name}:\n    get:\n      operationId: \"sayHello\"\n      parameters:\n      - name: \"name\"\n        in: \"path\"\n        required: true\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n"
  },
  {
    "path": "samples/verify-with-code-sample/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>samples</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n\n  <artifactId>verify-with-code-sample</artifactId>\n  <packaging>pom</packaging>\n  <modules>\n    <module>GreetingService</module>\n  </modules>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.servicecomb.toolkit</groupId>\n        <artifactId>toolkit-maven-plugin</artifactId>\n        <version>0.3.0-SNAPSHOT</version>\n        <configuration>\n          <!-- Set to 'code' to resolve the current project. Set to 'contract' to resolve the contract file for the specified path.If not set, the default is 'code' -->\n          <sourceType>code</sourceType>\n          <!-- Sample contract file path, must be set -->\n          <destinationContractPath>./contract</destinationContractPath>\n        </configuration>\n      </plugin>\n    </plugins>\n  </build>\n</project>"
  },
  {
    "path": "scripts/cliTest.sh",
    "content": "#!/usr/bin/env bash\n## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n#bin/sh\n\nprojectDir=$(pwd)\n\n# get an binary package\nmvn clean install -DskipTests -Prelease -Dgpg.skip=true\ncd toolkit-distribution/target/\nunzip apache-servicecomb-toolkit-distribution-*-bin.zip\ncd apache-servicecomb-toolkit-distribution-*-bin\n\nfunction checkFail\n{\n  if [ $? -ne 0 ]; then\n    echo \"run $1 failed\"\n    exit 1\n  fi\n}\n\nfunction helpTest\n{\n  # help\n  ./cli.sh help\n\n  checkFail helpTest\n  echo \"./cli.sh help test success\"\n}\n\nfunction codegenerateTest\n{\n  # codegenerate\n\n  for programingModel in \"SpringMVC\" \"POJO\" \"JAX-RS\" \"SpringBoot\"\n  do\n    ./cli.sh codegenerate \\\n     -m ServiceComb \\\n     -i ${projectDir}/cli/src/test/resources/swagger.yaml \\\n     -o ${projectDir}/target \\\n     -p ${programingModel} 2>&1 \\\n     | grep \"Success to generate code\"\n\n    checkFail codegenerateTest\n    echo \"generate ${programingModel} is ok\"\n  done\n\n  echo \"./cli.sh codegenerate test success\"\n}\n\nfunction docgenerateTest\n{\n  # docgenerate\n  ./cli.sh docgenerate \\\n   -i ${projectDir}/cli/src/test/resources/swagger.yaml \\\n   -o ${projectDir}/target 2>&1\n\n  checkFail docgenerateTest\n  echo \"./cli.sh docgenerate test success\"\n}\n\nfunction checkstyleTest\n{\n  # checkstyle\n  ./cli.sh checkstyle \\\n   -r ${projectDir}/cli/src/test/resources/oas/style-rules.properties \\\n   -f ${projectDir}/cli/src/test/resources/oas/style.yaml 2>&1 \\\n   | grep \"check not passed\"\n\n  checkFail checkstyleTest\n\n  ./cli.sh cs \\\n   -r ${projectDir}/cli/src/test/resources/oas/style-rules.properties \\\n   -f ${projectDir}/cli/src/test/resources/oas/style.yaml 2>&1 \\\n   | grep \"check not passed\"\n\n  checkFail checkstyleTest\n\n  echo \"./cli.sh checkstyle test success\"\n}\n\nfunction checkcompatibilityTest\n{\n  # checkcompatibility\n  ./cli.sh checkcompatibility \\\n   ${projectDir}/cli/src/test/resources/oas/compatibility-left.yaml \\\n   ${projectDir}/cli/src/test/resources/oas/compatibility-right.yaml 2>&1 \\\n   | grep \"adding is not allowed on right side\"\n\n  checkFail checkcompatibilityTest\n\n  ./cli.sh cc \\\n   ${projectDir}/cli/src/test/resources/oas/compatibility-left.yaml \\\n   ${projectDir}/cli/src/test/resources/oas/compatibility-right.yaml 2>&1 \\\n   | grep \"adding is not allowed on right side\"\n\n  checkFail checkcompatibilityTest\n  echo \"./cli.sh checkcompatibility test success\"\n}\n\nhelpTest\ncodegenerateTest\ndocgenerateTest\ncheckstyleTest\ncheckcompatibilityTest\n"
  },
  {
    "path": "scripts/deploy.sh",
    "content": "#!/usr/bin/env bash\n## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n#bin/sh\n\nVERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)\nif [[ ! $VERSION =~ \"SNAPSHOT\" ]]; then\n  echo \"${green}[SCRIPT] Not Snapshot Version,Skipping Deployment.${reset}\"\nelse\n  echo \"Deploy a Non-Signed Staging Release\"\n  mvn deploy -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B -DskipTests --settings .travis.settings.xml\n  if [ $? == 0 ]; then\n        echo \"${green}Snapshot Deployment is Success, please log on to Nexus Repo to see the snapshot release..${reset}\"\n  else\n        echo \"${red}Snapshot deployment failed.${reset}\"\n  fi\n  echo \"Deployment Completed\"\nfi\n"
  },
  {
    "path": "scripts/test.sh",
    "content": "#!/usr/bin/env bash\n## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n#bin/sh\n\n##Check if the commit is tagged commit or not\nTAGGEDCOMMIT=$(git tag -l --contains HEAD)\nif [ \"$TAGGEDCOMMIT\" == \"\" ]; then\n  TAGGEDCOMMIT=false\nelse\n  TAGGEDCOMMIT=true\nfi\necho \"${green}[SCRIPT] TAGGEDCOMMIT=$TAGGEDCOMMIT${reset}\"\n\nif [ \"$TAGGEDCOMMIT\" == \"true\" ]; then\n  echo \"${green}[SCRIPT] Skipping the installation as it is tagged commit.${reset}\"\nelse\n  mvn apache-rat:check\n  if [ $? != 0 ]; then\n    echo \"${red}[SCRIPT] Rat check failed.${reset}\"\n    exit 1\n  fi\n  \n  MVN_CMD=\"clean install -Pjacoco\"\n  \n  if [ -n \"$TRAVIS_JOB_ID\" ]; then\n    echo \"${green}[SCRIPT] It's a travis job.${reset}\"\n    MVN_CMD=\"$MVN_CMD coveralls:report\"\n  else\n    echo \"${green}[SCRIPT] It's not a travis job.${reset}\"\n  fi\n  \n  echo \"${green}[SCRIPT] TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST${reset}\"\n  if [ \"$TRAVIS_PULL_REQUEST\" == \"false\" ]; then\n    echo \"${green}[SCRIPT] It's not a PR build, enable sonar.${reset}\"\n    MVN_CMD=\"$MVN_CMD sonar:sonar -Dsonar.projectKey=servicecomb-toolkit\"\n  else\n    echo \"${green}[SCRIPT] It's a PR build or local build.${reset}\"\n  fi;\n  \n  echo \"${green}[SCRIPT] Running unit and integration tests.${reset}\"\n  mvn $MVN_CMD\n  \n  if [ $? == 0 ]; then\n    echo \"${green}[SCRIPT] Build success.${reset}\"\n  else\n    echo \"${red}[SCRIPT] Build or tests failed, please check the logs for more details.${reset}\"\n    exit 1\n  fi\nfi"
  },
  {
    "path": "toolkit-distribution/pom.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n  <parent>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>toolkit</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <artifactId>apache-servicecomb-toolkit-distribution</artifactId>\n  <name>Toolkit::Distribution</name>\n  <packaging>pom</packaging>\n\n  <!-- sort by project directory name, easy to check if the module is missed -->\n  <dependencies>\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>cli</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>codegen</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>contractgen</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>common</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>core</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>docgen</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-core</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-core-spring</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-style</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-compatibility</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-validator-compatibility-spring</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-generator-core</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-generator-servicecomb</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-generator-jaxrs</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>oas-generator-spring</artifactId>\n      <version>${project.version}</version>\n    </dependency>\n\n  </dependencies>\n\n  <profiles>\n    <profile>\n      <id>release</id>\n      <build>\n        <plugins>\n          <plugin>\n            <artifactId>maven-assembly-plugin</artifactId>\n            <version>3.2.0</version>\n            <executions>\n              <execution>\n                <id>src</id>\n                <phase>package</phase>\n                <goals>\n                  <goal>single</goal>\n                </goals>\n                <configuration>\n                  <descriptors>\n                    <descriptor>src/assembly/src.xml</descriptor>\n                  </descriptors>\n                </configuration>\n              </execution>\n              <execution>\n                <id>bin</id>\n                <phase>package</phase>\n                <goals>\n                  <goal>single</goal>\n                </goals>\n                <configuration>\n                  <descriptors>\n                    <descriptor>src/assembly/bin.xml</descriptor>\n                  </descriptors>\n                </configuration>\n              </execution>\n            </executions>\n          </plugin>\n        </plugins>\n      </build>\n    </profile>\n  </profiles>\n</project>\n"
  },
  {
    "path": "toolkit-distribution/src/assembly/bin.xml",
    "content": "<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<assembly xmlns=\"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd\">\n  <includeBaseDirectory>true</includeBaseDirectory>\n  <baseDirectory>${project.build.finalName}-bin</baseDirectory>\n  <id>bin</id>\n  <formats>\n    <format>zip</format>\n  </formats>\n  <fileSets>\n    <fileSet>\n      <directory>../</directory>\n      <outputDirectory>/</outputDirectory>\n      <includes>\n        <include>DISCLAIMER</include>\n        <include>README.md</include>\n      </includes>\n    </fileSet>\n    <fileSet>\n      <directory>src/release</directory>\n      <outputDirectory>/</outputDirectory>\n      <includes>\n        <include>NOTICE</include>\n        <include>LICENSE</include>\n        <include>licenses/**</include>\n      </includes>\n    </fileSet>\n    <fileSet>\n      <directory>../cli/scripts</directory>\n      <outputDirectory>/</outputDirectory>\n      <includes>\n        <include>cli.sh</include>\n        <include>cli.cmd</include>\n      </includes>\n    </fileSet>\n  </fileSets>\n  <dependencySets>\n    <dependencySet>\n      <useProjectArtifact>true</useProjectArtifact>\n      <unpack>false</unpack>\n      <outputDirectory>/libs</outputDirectory>\n      <scope>runtime</scope>\n    </dependencySet>\n  </dependencySets>\n</assembly>\n"
  },
  {
    "path": "toolkit-distribution/src/assembly/src.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n    Licensed to the Apache Software Foundation (ASF) under one or more\n    contributor license agreements.  See the NOTICE file distributed with\n    this work for additional information regarding copyright ownership.\n    The ASF licenses this file to You under the Apache License, Version 2.0\n    (the \"License\"); you may not use this file except in compliance with\n    the License.  You may obtain a copy of the License at\n\n         http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n-->\n<assembly>\n  <id>src</id>\n  <formats>\n    <format>zip</format>\n  </formats>\n  <includeBaseDirectory>true</includeBaseDirectory>\n  <baseDirectory>${project.build.finalName}-src</baseDirectory>\n  <fileSets>\n    <!-- Binary Files -->\n    <fileSet>\n      <directory>..</directory>\n      <outputDirectory></outputDirectory>\n      <includes>\n        <include>**/*</include>\n      </includes>\n      <!-- excludes the binary files -->\n      <excludes>\n        <!-- exclude the mvn wrapper in the source artifact -->\n        <exclude>mvnw*</exclude>\n        <exclude>.mvn/**</exclude>\n\n        <exclude>**/eclipse-classes/**</exclude>\n        <exclude>**/target/**</exclude>\n        <exclude>**/build/**</exclude>\n        <exclude>**/eclipse-classes/**</exclude>\n        <exclude>**/.*</exclude>\n        <exclude>**/.*/**</exclude>\n        <exclude>*.enc</exclude>\n        <exclude>*.gpg</exclude>\n        <exclude>random_seed</exclude>\n        <exclude>**/surefire*</exclude>\n        <exclude>**/svn-commit*</exclude>\n\n        <exclude>**/.idea/**</exclude>\n        <exclude>**/*.iml</exclude>\n        <exclude>**/*.ipr</exclude>\n        <exclude>**/*.iws</exclude>\n\n        <exclude>**/cobertura.ser</exclude>\n\n        <exclude>**/node_modules/**</exclude>\n      </excludes>\n    </fileSet>\n\n  </fileSets>\n</assembly>\n"
  },
  {
    "path": "toolkit-distribution/src/release/LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n=======================================================================\nApache ServiceComb Toolkit Subcomponents:\n\nThe Apache ServiceComb Toolkit project contains subcomponents with\nseparate copyright notices and license terms. Your use of these\nsubcomponents is subject to the terms and conditions of the\nfollowing licenses.\n\n================================================================\nThis product bundles libraries which are licensed under the\nMozilla Public License, Version 2.0\nYou can find a copy of the License at licenses/LICENSE-mozilla-v20\n\n* Mozilla Rhino (org.mozilla:rhino:1.7R4 - https://developer.mozilla.org/en/Rhino)\n\n================================================================\nThis product bundles library which is licensed under the\nCOMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1.\nYou can find a copy of the License at licenses/LICENSE-cddl\n\n* JavaMail API jar (javax.mail:mailapi:1.4.3 - http://java.sun.com/projects/javamail/mailapi)\n* Java Servlet API (javax.servlet:javax.servlet-api:4.0.1 - http://servlet-spec.java.net)\n* JavaBeans(TM) Activation Framework (javax.activation:activation:1.1 - http://java.sun.com/products/javabeans/jaf/index.jsp)\n* javax.annotation API (javax.annotation:javax.annotation-api:1.3.2 - http://jcp.org/en/jsr/detail?id=250)\n* javax.ws.rs-api (javax.ws.rs:javax.ws.rs-api:2.0.1 - http://jax-rs-spec.java.net)\n* jaxb-api (javax.xml.bind:jaxb-api:2.3.0 - https://github.com/javaee/jaxb-spec/jaxb-api)\n\n================================================================\nThis product bundles jopt libraries which is licensed under the\nMIT license.\nYou can find a copy of the License at licenses/LICENSE-jopt\n\n* JOpt Simple (net.sf.jopt-simple:jopt-simple:5.0.3 - http://pholser.github.io/jopt-simple)\n\n================================================================\nThis product bundles slf4j libraries which is licensed under the\nMIT license.\nFor details, see http://www.slf4j.org\nYou can find a copy of the License at licenses/LICENSE-slf4j\n\n* JUL to SLF4J bridge (org.slf4j:jul-to-slf4j:1.7.26 - http://www.slf4j.org)\n* SLF4J API Module (org.slf4j:slf4j-api:1.6.3 - http://www.slf4j.org)\n* SLF4J API Module (org.slf4j:slf4j-api:1.7.12 - http://www.slf4j.org)\n* SLF4J API Module (org.slf4j:slf4j-api:1.7.25 - http://www.slf4j.org)\n* SLF4J Extensions Module (org.slf4j:slf4j-ext:1.7.12 - http://www.slf4j.org)\n* SLF4J Simple Binding (org.slf4j:slf4j-simple:1.7.12 - http://www.slf4j.org)\n\n===========================================================================\nThis product bundles of Hamcrest which is licensed under BSD 3-Clause License\nFor details, see https://github.com/hamcrest/JavaHamcrest/blob/master/LICENSE.txt\nYou can find a copy of the License at licenses/LICENSE-hamcrest\n\n* Hamcrest Core (org.hamcrest:hamcrest-core:1.3 - https://github.com/hamcrest/JavaHamcrest/hamcrest-core)\n* Hamcrest library (org.hamcrest:hamcrest-library:1.3 - https://github.com/hamcrest/JavaHamcrest/hamcrest-library)\n\n===========================================================================\nThis product bundles of Hamcrest which is licensed under BSD 3-Clause License\nFor details, see https://www.threeten.org/threetenbp\nYou can find a copy of the License at licenses/LICENSE-threetenbp\n\n* ThreeTen backport (org.threeten:threetenbp:1.3.1 - https://www.threeten.org/threetenbp)\n\n===========================================================================\nThis product bundles of Hamcrest which is licensed under BSD License\nFor details, see http://www.brics.dk/automaton/\nYou can find a copy of the License at licenses/LICENSE-automaton\n\n* Automaton (dk.brics.automaton:automaton:1.11-8 - http://www.brics.dk/automaton/)\n\n================================================================\nThis product bundles files from stax2 which is licensed under the\n2-Clause BSD license.\nFor details, see http://wiki.fasterxml.com/WoodstoxStax2\nYou can find a copy of the License at licenses/LICENSE-woodstox-stax2-api\n\n* Stax2 API (org.codehaus.woodstox:stax2-api:3.1.4 - http://wiki.fasterxml.com/WoodstoxStax2)\n\n================================================================\nThis product bundles commonmark which is licensed under the\n2-Clause BSD license.\nFor details, see https://github.com/atlassian/commonmark-java\nYou can find a copy of the License at licenses/LICENSE-commonmark\n\n* CommonMark Java Core (com.atlassian.commonmark:commonmark:0.9.0 - https://github.com/atlassian/commonmark-java)\n\n================================================================\nThis product bundles aopalliance which is licensed under the\npublic domain.\nFor details, see http://aopalliance.sourceforge.net/\n\n* AOP alliance (aopalliance:aopalliance:1.0 - http://aopalliance.sourceforge.net)\n\n================================================================\nThis product bundles Compiler assisted localization library (CAL10N) which is licensed under the\nMIT license.\nYou can find a copy of the License at licenses/LICENSE-cal10n\n\n* Compiler assisted localization library (CAL10N) - API (ch.qos.cal10n:cal10n-api:0.8.1 - http://cal10n.qos.ch/cal10n-api)\n* Compiler assisted localization library (CAL10N) - API (ch.qos.cal10n:cal10n-api:0.7.4 - http://cal10n.qos.ch/cal10n-api)\n\n===========================================================================\nThis product bundles of asm which is licensed under BSD 3-Clause License\nFor details, see https://asm.ow2.io/license.html \nYou can find a copy of the License at licenses/LICENSE-asm\n\n* asm (org.ow2.asm:asm:7.2 - http://asm.ow2.io/)\n\n================================================================\nThis product bundles the following libraries which are licensed\nunder the Apache License v2.\nFor details, see their respective project links.\n\n* A Jackson 2.x helper (com.github.jknack:handlebars-jackson2:4.1.2 - https://github.com/jknack/handlebars.java/handlebars-jackson2)\n* ASM based accessors helper used by json-smart (net.minidev:accessors-smart:1.2 - http://www.minidev.net/)\n* Apache Commons Codec (commons-codec:commons-codec:1.9 - http://commons.apache.org/proper/commons-codec/)\n* Apache Commons Collections (org.apache.commons:commons-collections4:4.3 - http://commons.apache.org/proper/commons-collections/)\n* Apache Commons Compress (org.apache.commons:commons-compress:1.16.1 - http://commons.apache.org/proper/commons-compress/)\n* Apache Commons Configuration (commons-configuration:commons-configuration:1.10 - http://commons.apache.org/configuration/)\n* Apache Commons Lang (org.apache.commons:commons-lang3:3.4 - http://commons.apache.org/proper/commons-lang/)\n* Apache Commons Lang (org.apache.commons:commons-lang3:3.8.1 - http://commons.apache.org/proper/commons-lang/)\n* Apache Commons Logging (commons-logging:commons-logging:1.2 - http://commons.apache.org/proper/commons-logging/)\n* Apache HttpClient (org.apache.httpcomponents:httpclient:4.5.2 - http://hc.apache.org/httpcomponents-client)\n* Apache HttpCore (org.apache.httpcomponents:httpcore:4.4.4 - http://hc.apache.org/httpcomponents-core-ga)\n* Apache Log4j (log4j:log4j:1.2.17 - http://logging.apache.org/log4j/1.2/)\n* Apache Log4j API (org.apache.logging.log4j:log4j-api:2.11.0 - https://logging.apache.org/log4j/2.x/log4j-api/)\n* Apache Log4j API (org.apache.logging.log4j:log4j-api:2.11.2 - https://logging.apache.org/log4j/2.x/log4j-api/)\n* Apache Log4j Core (org.apache.logging.log4j:log4j-core:2.11.0 - https://logging.apache.org/log4j/2.x/log4j-core/)\n* Apache Log4j SLF4J Binding (org.apache.logging.log4j:log4j-slf4j-impl:2.11.0 - https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/)\n* Apache Log4j to SLF4J Adapter (org.apache.logging.log4j:log4j-to-slf4j:2.11.2 - https://logging.apache.org/log4j/2.x/log4j-to-slf4j/)\n* AssertJ fluent assertions (org.assertj:assertj-core:3.11.1 - http://assertj.org/assertj-core)\n* Bean Validation API (javax.validation:validation-api:2.0.1.Final - http://beanvalidation.org)\n* Bootstrap (org.webjars:bootstrap:4.3.1 - http://webjars.org)\n* Byte Buddy (without dependencies) (net.bytebuddy:byte-buddy:1.9.3 - http://bytebuddy.net/byte-buddy)\n* Byte Buddy Java agent (net.bytebuddy:byte-buddy-agent:1.9.3 - http://bytebuddy.net/byte-buddy-agent)\n* ClassMate (com.fasterxml:classmate:1.3.4 - http://github.com/FasterXML/java-classmate)\n* Commons CLI (commons-cli:commons-cli:1.2 - http://commons.apache.org/cli/)\n* Commons IO (commons-io:commons-io:2.4 - http://commons.apache.org/io/)\n* FindBugs-jsr305 (com.google.code.findbugs:jsr305:3.0.1 - http://findbugs.sourceforge.net/)\n* Generex (com.github.mifmif:generex:1.0.2 - https://github.com/mifmif/Generex/tree/master)\n* Google Guice - Core Library (com.google.inject:guice:4.1.0 - https://github.com/google/guice/guice)\n* Guava InternalFutureFailureAccess and InternalFutures (com.google.guava:failureaccess:1.0.1 - https://github.com/google/guava/failureaccess)\n* Guava ListenableFuture only (com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava - https://github.com/google/guava/listenablefuture)\n* Guava: Google Core Libraries for Java (com.google.guava:guava:18.0 - http://code.google.com/p/guava-libraries/guava)\n* Guava: Google Core Libraries for Java (com.google.guava:guava:27.0.1-android - https://github.com/google/guava/guava)\n* Handlebars (com.github.jknack:handlebars:4.1.2 - https://github.com/jknack/handlebars.java/handlebars)\n* Hibernate Validator Engine (org.hibernate.validator:hibernate-validator:6.0.16.Final - http://hibernate.org/validator/hibernate-validator)\n* J2ObjC Annotations (com.google.j2objc:j2objc-annotations:1.1 - https://github.com/google/j2objc/)\n* JBoss Logging 3 (org.jboss.logging:jboss-logging:3.3.2.Final - http://www.jboss.org)\n* JSON Small and Fast Parser (net.minidev:json-smart:2.3 - http://www.minidev.net/)\n* JSON library from Android SDK (com.vaadin.external.google:android-json:0.0.20131108.vaadin1 - http://developer.android.com/sdk)\n* JSONassert (org.skyscreamer:jsonassert:1.5.0 - https://github.com/skyscreamer/JSONassert)\n* Jackson datatype: Guava (com.fasterxml.jackson.datatype:jackson-datatype-guava:2.9.5 - https://github.com/FasterXML/jackson-datatypes-collections)\n* Jackson datatype: JSR310 (com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.5 - https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310)\n* Jackson datatype: JSR310 (com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8 - https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310)\n* Jackson datatype: jdk8 (com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.8 - https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jdk8)\n* Jackson module: JAXB Annotations (com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.9.8 - https://github.com/FasterXML/jackson-modules-base)\n* Jackson-Datatype-ThreeTenBackport (com.github.joschi.jackson:jackson-datatype-threetenbp:2.6.4 - https://github.com/joschi/jackson-datatype-threetenbp)\n* Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations:2.9.0 - http://github.com/FasterXML/jackson)\n* Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations:2.9.8 - http://github.com/FasterXML/jackson)\n* Jackson-core (com.fasterxml.jackson.core:jackson-core:2.9.5 - https://github.com/FasterXML/jackson-core)\n* Jackson-core (com.fasterxml.jackson.core:jackson-core:2.9.8 - https://github.com/FasterXML/jackson-core)\n* Jackson-dataformat-XML (com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.8 - http://wiki.fasterxml.com/JacksonExtensionXmlDataBinding)\n* Jackson-dataformat-YAML (com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.8 - https://github.com/FasterXML/jackson-dataformats-text)\n* Jackson-datatype-Joda (com.fasterxml.jackson.datatype:jackson-datatype-joda:2.9.5 - http://wiki.fasterxml.com/JacksonModuleJoda)\n* Jackson-module-parameter-names (com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.8 - https://github.com/FasterXML/jackson-modules-java8/jackson-module-parameter-names)\n* Java Chassis::Common::Javassist (org.apache.servicecomb:common-javassist:1.2.0 - https://github.com/apache/servicecomb-java-chassis/common/common-javassist)\n* Java Chassis::Foundations::Common (org.apache.servicecomb:foundation-common:1.2.0 - https://github.com/apache/servicecomb-java-chassis/foundations/foundation-common)\n* Java Chassis::Swagger::Generator::Core (org.apache.servicecomb:swagger-generator-core:1.2.0 - https://github.com/apache/servicecomb-java-chassis/swagger/swagger-generator/swagger-generator-core)\n* Joda-Time (joda-time:joda-time:2.7 - http://www.joda.org/joda-time/)\n* Joda-Time (joda-time:joda-time:2.9.7 - http://www.joda.org/joda-time/)\n* Objenesis (org.objenesis:objenesis:2.6 - http://objenesis.org)\n* SnakeYAML (org.yaml:snakeyaml:1.23 - http://www.snakeyaml.org)\n* Spring AOP (org.springframework:spring-aop:4.3.20.RELEASE - https://github.com/spring-projects/spring-framework)\n* Spring AOP (org.springframework:spring-aop:5.1.6.RELEASE - https://github.com/spring-projects/spring-framework)\n* Spring Beans (org.springframework:spring-beans:4.3.20.RELEASE - https://github.com/spring-projects/spring-framework)\n* Spring Beans (org.springframework:spring-beans:5.1.6.RELEASE - https://github.com/spring-projects/spring-framework)\n* Spring Boot (org.springframework.boot:spring-boot:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot)\n* Spring Boot Actuator (org.springframework.boot:spring-boot-actuator:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-actuator)\n* Spring Boot Actuator AutoConfigure (org.springframework.boot:spring-boot-actuator-autoconfigure:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-actuator-autoconfigure)\n* Spring Boot Actuator Starter (org.springframework.boot:spring-boot-starter-actuator:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-actuator)\n* Spring Boot AutoConfigure (org.springframework.boot:spring-boot-autoconfigure:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-autoconfigure)\n* Spring Boot Json Starter (org.springframework.boot:spring-boot-starter-json:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-json)\n* Spring Boot Logging Starter (org.springframework.boot:spring-boot-starter-logging:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-logging)\n* Spring Boot Starter (org.springframework.boot:spring-boot-starter:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter)\n* Spring Boot Test (org.springframework.boot:spring-boot-test:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-test)\n* Spring Boot Test Auto-Configure (org.springframework.boot:spring-boot-test-autoconfigure:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-test-autoconfigure)\n* Spring Boot Test Starter (org.springframework.boot:spring-boot-starter-test:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-test)\n* Spring Boot Thymeleaf Starter (org.springframework.boot:spring-boot-starter-thymeleaf:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-thymeleaf)\n* Spring Boot Tomcat Starter (org.springframework.boot:spring-boot-starter-tomcat:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-tomcat)\n* Spring Boot Web Starter (org.springframework.boot:spring-boot-starter-web:2.1.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-web)\n* Spring Commons Logging Bridge (org.springframework:spring-jcl:5.1.6.RELEASE - https://github.com/spring-projects/spring-framework)\n* Spring Context (org.springframework:spring-context:4.3.20.RELEASE - https://github.com/spring-projects/spring-framework)\n* Spring Context (org.springframework:spring-context:5.1.6.RELEASE - https://github.com/spring-projects/spring-framework)\n* Spring Core (org.springframework:spring-core:4.3.20.RELEASE - https://github.com/spring-projects/spring-framework)\n* Spring Core (org.springframework:spring-core:5.1.6.RELEASE - https://github.com/spring-projects/spring-framework)\n* Spring Expression Language (SpEL) (org.springframework:spring-expression:4.3.20.RELEASE - https://github.com/spring-projects/spring-framework)\n* Spring Expression Language (SpEL) (org.springframework:spring-expression:5.1.6.RELEASE - https://github.com/spring-projects/spring-framework)\n* Spring TestContext Framework (org.springframework:spring-test:5.1.6.RELEASE - https://github.com/spring-projects/spring-framework)\n* Spring Web (org.springframework:spring-web:5.1.6.RELEASE - https://github.com/spring-projects/spring-framework)\n* Spring Web MVC (org.springframework:spring-webmvc:5.1.6.RELEASE - https://github.com/spring-projects/spring-framework)\n* Woodstox (com.fasterxml.woodstox:woodstox-core:5.0.3 - https://github.com/FasterXML/woodstox)\n* airline (io.airlift:airline:0.7 - https://github.com/airlift/airline)\n* attoparser (org.attoparser:attoparser:2.0.5.RELEASE - http://www.attoparser.org)\n* codegen (org.apache.servicecomb.toolkit:codegen:0.2.0-SNAPSHOT - https://github.com/apache/servicecomb-toolkit/codegen)\n* com.github.fge:btf (com.github.fge:btf:1.2 - https://github.com/fge/btf)\n* com.github.fge:jackson-coreutils (com.github.fge:jackson-coreutils:1.6 - https://github.com/fge/jackson-coreutils)\n* com.github.fge:json-patch (com.github.fge:json-patch:1.6 - https://github.com/fge/json-patch)\n* com.github.fge:msg-simple (com.github.fge:msg-simple:1.1 - https://github.com/fge/msg-simple)\n* com.github.fge:uri-template (com.github.fge:uri-template:0.9 - https://github.com/fge/uri-template)\n* core (org.apache.servicecomb.toolkit:core:0.2.0-SNAPSHOT - https://github.com/apache/servicecomb-toolkit/core)\n* docgen (org.apache.servicecomb.toolkit:docgen:0.2.0-SNAPSHOT - https://github.com/apache/servicecomb-toolkit/docgen)\n* error-prone annotations (com.google.errorprone:error_prone_annotations:2.2.0 - http://nexus.sonatype.org/oss-repository-hosting.html/error_prone_parent/error_prone_annotations)\n* jackson-databind (com.fasterxml.jackson.core:jackson-databind:2.9.8 - http://github.com/FasterXML/jackson)\n* javax.inject (javax.inject:javax.inject:1 - http://code.google.com/p/atinject/)\n* json-schema-core (com.github.java-json-tools:json-schema-core:1.2.8 - https://github.com/java-json-tools/json-schema-core)\n* json-schema-validator (com.github.java-json-tools:json-schema-validator:2.2.8 - https://github.com/box-metadata/json-schema-validator)\n* libphonenumber (com.googlecode.libphonenumber:libphonenumber:8.0.0 - https://github.com/googlei18n/libphonenumber/)\n* micrometer-core (io.micrometer:micrometer-core:1.1.4 - https://github.com/micrometer-metrics/micrometer)\n* oas-validator-compatibility (org.apache.servicecomb.toolkit:oas-validator-compatibility:0.2.0-SNAPSHOT - no url defined)\n* oas-validator-compatibility-spring (org.apache.servicecomb.toolkit:oas-validator-compatibility-spring:0.2.0-SNAPSHOT - no url defined)\n* oas-validator-style (org.apache.servicecomb.toolkit:oas-validator-style:0.2.0-SNAPSHOT - no url defined)\n* oas-validator-core (org.apache.servicecomb.toolkit:oas-validator-core:0.2.0-SNAPSHOT - no url defined)\n* oas-validator-core-spring (org.apache.servicecomb.toolkit:oas-validator-core-spring:0.2.0-SNAPSHOT - no url defined)\n* oas-validator-test (org.apache.servicecomb.toolkit:oas-validator-test:0.2.0-SNAPSHOT - no url defined)\n* openapi-generator (core library) (org.openapitools:openapi-generator:4.1.2 - https://github.com/openapitools/openapi-generator/modules/openapi-generator)\n* openapi-generator-core (org.openapitools:openapi-generator-core:4.1.2 - https://github.com/openapitools/openapi-generator)\n* org.xmlunit:xmlunit-core (org.xmlunit:xmlunit-core:2.6.2 - https://www.xmlunit.org/)\n* project ':json-path' (com.jayway.jsonpath:json-path:2.4.0 - https://github.com/jayway/JsonPath)\n* swagger-annotations (io.swagger.core.v3:swagger-annotations:2.0.8 - https://github.com/swagger-api/swagger-core/modules/swagger-annotations)\n* Spring Web (org.springframework:spring-web:5.2.0.RELEASE - https://github.com/spring-projects/spring-framework)\n* swagger-annotations (io.swagger:swagger-annotations:1.5.22 - https://github.com/swagger-api/swagger-core/modules/swagger-annotations)\n* swagger-annotations (io.swagger.core.v3:swagger-annotations:2.0.9 - https://github.com/swagger-api/swagger-core/modules/swagger-annotations)\n* swagger-annotations (io.swagger:swagger-annotations:1.5.22 - https://github.com/swagger-api/swagger-core/modules/swagger-annotations)\n* swagger-codegen (core library) (io.swagger:swagger-codegen:2.4.3 - https://github.com/swagger-api/swagger-codegen/modules/swagger-codegen)\n* swagger-compat-spec-parser (io.swagger:swagger-compat-spec-parser:1.0.43 - http://nexus.sonatype.org/oss-repository-hosting.html/swagger-parser-project/modules/swagger-compat-spec-parser)\n* swagger-compat-spec-parser (io.swagger:swagger-compat-spec-parser:1.0.44 - http://nexus.sonatype.org/oss-repository-hosting.html/swagger-parser-project/modules/swagger-compat-spec-parser)\n* swagger-core (io.swagger.core.v3:swagger-core:2.0.8 - https://github.com/swagger-api/swagger-core/modules/swagger-core)\n* swagger-core (io.swagger.core.v3:swagger-core:2.0.9 - https://github.com/swagger-api/swagger-core/modules/swagger-core)\n* swagger-core (io.swagger:swagger-core:1.5.22 - https://github.com/swagger-api/swagger-core/modules/swagger-core)\n* swagger-models (io.swagger.core.v3:swagger-models:2.0.8 - https://github.com/swagger-api/swagger-core/modules/swagger-models)\n* swagger-models (io.swagger.core.v3:swagger-models:2.0.9 - https://github.com/swagger-api/swagger-core/modules/swagger-models)\n* swagger-models (io.swagger:swagger-models:1.5.22 - https://github.com/swagger-api/swagger-core/modules/swagger-models)\n* swagger-parser (io.swagger.parser.v3:swagger-parser-core:2.0.12 - http://nexus.sonatype.org/oss-repository-hosting.html/swagger-parser-project/modules/swagger-parser-core)\n* swagger-parser (io.swagger.parser.v3:swagger-parser:2.0.12 - http://nexus.sonatype.org/oss-repository-hosting.html/swagger-parser-project/modules/swagger-parser)\n* swagger-parser (io.swagger:swagger-parser:1.0.43 - http://nexus.sonatype.org/oss-repository-hosting.html/swagger-parser-project/modules/swagger-parser)\n* swagger-parser (io.swagger:swagger-parser:1.0.44 - http://nexus.sonatype.org/oss-repository-hosting.html/swagger-parser-project/modules/swagger-parser)\n* swagger-parser (org.openapitools.swagger.parser:swagger-parser-core:2.0.14-OpenAPITools.org-1 - http://nexus.sonatype.org/oss-repository-hosting.html/swagger-parser-project/modules/swagger-parser-core)\n* swagger-parser (org.openapitools.swagger.parser:swagger-parser:2.0.14-OpenAPITools.org-1 - http://nexus.sonatype.org/oss-repository-hosting.html/swagger-parser-project/modules/swagger-parser)\n* swagger-parser-v2-converter (io.swagger.parser.v3:swagger-parser-v2-converter:2.0.12 - http://nexus.sonatype.org/oss-repository-hosting.html/swagger-parser-project/modules/swagger-parser-v2-converter)\n* swagger-parser-v2-converter (org.openapitools.swagger.parser:swagger-parser-v2-converter:2.0.14-OpenAPITools.org-1 - http://nexus.sonatype.org/oss-repository-hosting.html/swagger-parser-project/modules/swagger-parser-v2-converter)\n* swagger-parser-v3 (io.swagger.parser.v3:swagger-parser-v3:2.0.12 - http://nexus.sonatype.org/oss-repository-hosting.html/swagger-parser-project/modules/swagger-parser-v3)\n* swagger-parser-v3 (org.openapitools.swagger.parser:swagger-parser-v3:2.0.14-OpenAPITools.org-1 - http://nexus.sonatype.org/oss-repository-hosting.html/swagger-parser-project/modules/swagger-parser-v3)\n* thymeleaf (org.thymeleaf:thymeleaf:3.0.11.RELEASE - http://www.thymeleaf.org)\n* thymeleaf-extras-java8time (org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.4.RELEASE - http://www.thymeleaf.org)\n* thymeleaf-spring5 (org.thymeleaf:thymeleaf-spring5:3.0.11.RELEASE - http://www.thymeleaf.org)\n* tomcat-embed-core (org.apache.tomcat.embed:tomcat-embed-core:9.0.17 - https://tomcat.apache.org/)\n* tomcat-embed-el (org.apache.tomcat.embed:tomcat-embed-el:9.0.17 - https://tomcat.apache.org/)\n* tomcat-embed-websocket (org.apache.tomcat.embed:tomcat-embed-websocket:9.0.17 - https://tomcat.apache.org/)\n* unbescape (org.unbescape:unbescape:1.1.6.RELEASE - http://www.unbescape.org)\n* archaius-core (com.netflix.archaius:archaius-core:0.7.3 - https://github.com/Netflix/archaius)\n\n===========================================================================\nThis product bundles Webjars which is licensed under the\nMIT License.\nFor details, see their respective project links.\nYou can find a copy of the License at licenses/LICENSE-webjars\n\n* Popper.js (org.webjars:popper.js:1.14.3 - http://webjars.org)\n* jquery (org.webjars:jquery:3.0.0 - http://webjars.org)\n\n===========================================================================\nThis product bundles Animal Sniffer Annotations which is licensed under the\nMIT License.\nFor details, see http://www.mojohaus.org/animal-sniffer/animal-sniffer-annotations\nYou can find a copy of the License at licenses/LICENSE-mit\n\n* Animal Sniffer Annotations (org.codehaus.mojo:animal-sniffer-annotations:1.17 - http://www.mojohaus.org/animal-sniffer/animal-sniffer-annotations)\n\n===========================================================================\nThis product bundles Checker Qual which is licensed under the\nMIT License.\nFor details, see https://checkerframework.org\nYou can find a copy of the License at licenses/LICENSE-mit\n\n* Checker Qual (org.checkerframework:checker-compat-qual:2.5.2 - https://checkerframework.org)\n\n===========================================================================\nThis product bundles Mockito which is licensed under the\nMIT License.\nFor details, see https://github.com/mockito/mockito\nYou can find a copy of the License at licenses/LICENSE-mockito\n\n* mockito-core (org.mockito:mockito-core:2.23.4 - https://github.com/mockito/mockito)\n\n===========================================================================\nThis product bundles Project Lombok which is licensed under the\nMIT License.\nFor details, see https://projectlombok.org\nYou can find a copy of the License at licenses/LICENSE-lombok\n\n* Project Lombok (org.projectlombok:lombok:1.18.6 - https://projectlombok.org)\n\n===========================================================================\nThis product bundles following libraries which is licensed under the\nPublic Domain, per Creative Commons CC0.\nFor details, see their respective project links.\nYou can find a copy of the License at licenses/LICENSE-cc0\n\n* HdrHistogram (org.hdrhistogram:HdrHistogram:2.1.9 - http://hdrhistogram.github.io/HdrHistogram/)\n* LatencyUtils (org.latencyutils:LatencyUtils:2.0.3 - http://latencyutils.github.io/LatencyUtils/)\n\n===========================================================================\nThis product bundles following libraries which is licensed under the\nEclipse Public License v1.0.\nFor details, see their respective project links.\nYou can find a copy of the License at licenses/LICENSE-epl-v10\n\n* Logback Classic Module (ch.qos.logback:logback-classic:1.2.3 - http://logback.qos.ch/logback-classic)\n* Logback Core Module (ch.qos.logback:logback-core:1.2.3 - http://logback.qos.ch/logback-core)\n\n===========================================================================\nThis product bundles ASM Core which is licensed under the\n3-Clause BSD.\nFor details, see http://asm.objectweb.org/asm/\nYou can find a copy of the License at licenses/LICENSE-asm\n\n* ASM Core (org.ow2.asm:asm:5.0.4 - http://asm.objectweb.org/asm/)\n\n===========================================================================\nThis product bundles jmustache which is licensed under The (New) BSD License.\nFor details, see http://github.com/samskivert/jmustache\nYou can find a copy of the License at licenses/LICENSE-jmustache\n\n* jmustache (com.samskivert:jmustache:1.14 - http://github.com/samskivert/jmustache)\n\n===========================================================================\nThis product bundles JSch which is licensed under Revised BSD.\nFor details, see http://www.jcraft.com/jsch/LICENSE.txt\nYou can find a copy of the License at licenses/LICENSE-jsch\n\n* JSch (com.jcraft:jsch:0.1.54 - http://www.jcraft.com/jsch/)\n\n===========================================================================\nThis product bundles JZlib which is licensed under Revised BSD.\nFor details, see http://www.jcraft.com/jzlib/LICENSE.txt\nYou can find a copy of the License at licenses/LICENSE-jzlib\n\n* JZlib (com.jcraft:jzlib:1.1.1 - http://www.jcraft.com/jzlib/)\n"
  },
  {
    "path": "toolkit-distribution/src/release/NOTICE",
    "content": "Apache ServiceComb Toolkit\nCopyright 2019-present The Apache Software Foundation\n\nThis product includes software developed at\nThe Apache Software Foundation (http://www.apache.org/).\n\n================================================================\nNotice for Apache Commons Codec\n\nSee licenses/NOTICE-apache-commons-codec\n\n================================================================\nNotice for Apache Commons Lang(Version 3)\n\nApache Commons Lang\nCopyright 2001-2014 The Apache Software Foundation\n\nThis product includes software from the Spring Framework,\nunder the Apache License 2.0 (see: StringUtils.containsWhitespace())\n\n================================================================\nNotice for Airline\n\nSee licenses/NOTICE-airline\n\n================================================================\nNotice for Apache Commons CLI\n\nSee licenses/NOTICE-apache-commons-cli\n\n================================================================\nNotice for Apache ServiceComb Java Chassis\n\nSee licenses/NOTICE-servicecomb-java-chassis\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-asm",
    "content": "ASM: a very small and fast Java bytecode manipulation framework\nCopyright (c) 2000-2011 INRIA, France Telecom\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n1. Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n3. Neither the name of the copyright holders nor the names of its\n  contributors may be used to endorse or promote products derived from\n  this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\nTHE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-automaton",
    "content": "Note: This license has also been called the \"Simplified BSD License\" and the \"FreeBSD License\". See also the 3-clause BSD License.\n\nCopyright <YEAR> <COPYRIGHT HOLDER>\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-cal10n",
    "content": "Copyright (c) 2009 QOS.ch\nAll rights reserved.\n\nPermission is hereby granted, free  of charge, to any person obtaining\na  copy  of this  software  and  associated  documentation files  (the\n\"Software\"), to  deal in  the Software without  restriction, including\nwithout limitation  the rights to  use, copy, modify,  merge, publish,\ndistribute,  sublicense, and/or sell  copies of  the Software,  and to\npermit persons to whom the Software  is furnished to do so, subject to\nthe following conditions:\n\nThe  above  copyright  notice  and  this permission  notice  shall  be\nincluded in all copies or substantial portions of the Software.\n\nTHE  SOFTWARE IS  PROVIDED  \"AS  IS\", WITHOUT  WARRANTY  OF ANY  KIND,\nEXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF\nMERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-cc0",
    "content": "CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN \"AS-IS\" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER.\nStatement of Purpose\nThe laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an \"owner\") of an original work of authorship and/or a database (each, a \"Work\").\n\nCertain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works (\"Commons\") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.\n\nFor these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the \"Affirmer\"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.\n\n1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights (\"Copyright and Related Rights\"). Copyright and Related Rights include, but are not limited to, the following:\n\nthe right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;\nmoral rights retained by the original author(s) and/or performer(s);\npublicity and privacy rights pertaining to a person's image or likeness depicted in a Work;\nrights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;\nrights protecting the extraction, dissemination, use and reuse of data in a Work;\ndatabase rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and\nother similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.\n2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the \"Waiver\"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose.\n\n3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the \"License\"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose.\n\n4. Limitations and Disclaimers.\n\nNo trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.\nAffirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.\nAffirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.\nAffirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-cddl",
    "content": "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1\n\n1. Definitions.\n\n    1.1. \"Contributor\" means each individual or entity that creates or\n    contributes to the creation of Modifications.\n\n    1.2. \"Contributor Version\" means the combination of the Original\n    Software, prior Modifications used by a Contributor (if any), and\n    the Modifications made by that particular Contributor.\n\n    1.3. \"Covered Software\" means (a) the Original Software, or (b)\n    Modifications, or (c) the combination of files containing Original\n    Software with files containing Modifications, in each case including\n    portions thereof.\n\n    1.4. \"Executable\" means the Covered Software in any form other than\n    Source Code.\n\n    1.5. \"Initial Developer\" means the individual or entity that first\n    makes Original Software available under this License.\n\n    1.6. \"Larger Work\" means a work which combines Covered Software or\n    portions thereof with code not governed by the terms of this License.\n\n    1.7. \"License\" means this document.\n\n    1.8. \"Licensable\" means having the right to grant, to the maximum\n    extent possible, whether at the time of the initial grant or\n    subsequently acquired, any and all of the rights conveyed herein.\n\n    1.9. \"Modifications\" means the Source Code and Executable form of\n    any of the following:\n\n    A. Any file that results from an addition to, deletion from or\n    modification of the contents of a file containing Original Software\n    or previous Modifications;\n\n    B. Any new file that contains any part of the Original Software or\n    previous Modification; or\n\n    C. Any new file that is contributed or otherwise made available\n    under the terms of this License.\n\n    1.10. \"Original Software\" means the Source Code and Executable form\n    of computer software code that is originally released under this\n    License.\n\n    1.11. \"Patent Claims\" means any patent claim(s), now owned or\n    hereafter acquired, including without limitation, method, process,\n    and apparatus claims, in any patent Licensable by grantor.\n\n    1.12. \"Source Code\" means (a) the common form of computer software\n    code in which modifications are made and (b) associated\n    documentation included in or with such code.\n\n    1.13. \"You\" (or \"Your\") means an individual or a legal entity\n    exercising rights under, and complying with all of the terms of,\n    this License. For legal entities, \"You\" includes any entity which\n    controls, is controlled by, or is under common control with You. For\n    purposes of this definition, \"control\" means (a) the power, direct\n    or indirect, to cause the direction or management of such entity,\n    whether by contract or otherwise, or (b) ownership of more than\n    fifty percent (50%) of the outstanding shares or beneficial\n    ownership of such entity.\n\n2. License Grants.\n\n    2.1. The Initial Developer Grant.\n\n    Conditioned upon Your compliance with Section 3.1 below and subject\n    to third party intellectual property claims, the Initial Developer\n    hereby grants You a world-wide, royalty-free, non-exclusive license:\n\n    (a) under intellectual property rights (other than patent or\n    trademark) Licensable by Initial Developer, to use, reproduce,\n    modify, display, perform, sublicense and distribute the Original\n    Software (or portions thereof), with or without Modifications,\n    and/or as part of a Larger Work; and\n\n    (b) under Patent Claims infringed by the making, using or selling of\n    Original Software, to make, have made, use, practice, sell, and\n    offer for sale, and/or otherwise dispose of the Original Software\n    (or portions thereof).\n\n    (c) The licenses granted in Sections 2.1(a) and (b) are effective on\n    the date Initial Developer first distributes or otherwise makes the\n    Original Software available to a third party under the terms of this\n    License.\n\n    (d) Notwithstanding Section 2.1(b) above, no patent license is\n    granted: (1) for code that You delete from the Original Software, or\n    (2) for infringements caused by: (i) the modification of the\n    Original Software, or (ii) the combination of the Original Software\n    with other software or devices.\n\n    2.2. Contributor Grant.\n\n    Conditioned upon Your compliance with Section 3.1 below and subject\n    to third party intellectual property claims, each Contributor hereby\n    grants You a world-wide, royalty-free, non-exclusive license:\n\n    (a) under intellectual property rights (other than patent or\n    trademark) Licensable by Contributor to use, reproduce, modify,\n    display, perform, sublicense and distribute the Modifications\n    created by such Contributor (or portions thereof), either on an\n    unmodified basis, with other Modifications, as Covered Software\n    and/or as part of a Larger Work; and\n\n    (b) under Patent Claims infringed by the making, using, or selling\n    of Modifications made by that Contributor either alone and/or in\n    combination with its Contributor Version (or portions of such\n    combination), to make, use, sell, offer for sale, have made, and/or\n    otherwise dispose of: (1) Modifications made by that Contributor (or\n    portions thereof); and (2) the combination of Modifications made by\n    that Contributor with its Contributor Version (or portions of such\n    combination).\n\n    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective\n    on the date Contributor first distributes or otherwise makes the\n    Modifications available to a third party.\n\n    (d) Notwithstanding Section 2.2(b) above, no patent license is\n    granted: (1) for any code that Contributor has deleted from the\n    Contributor Version; (2) for infringements caused by: (i) third\n    party modifications of Contributor Version, or (ii) the combination\n    of Modifications made by that Contributor with other software\n    (except as part of the Contributor Version) or other devices; or (3)\n    under Patent Claims infringed by Covered Software in the absence of\n    Modifications made by that Contributor.\n\n3. Distribution Obligations.\n\n    3.1. Availability of Source Code.\n\n    Any Covered Software that You distribute or otherwise make available\n    in Executable form must also be made available in Source Code form\n    and that Source Code form must be distributed only under the terms\n    of this License. You must include a copy of this License with every\n    copy of the Source Code form of the Covered Software You distribute\n    or otherwise make available. You must inform recipients of any such\n    Covered Software in Executable form as to how they can obtain such\n    Covered Software in Source Code form in a reasonable manner on or\n    through a medium customarily used for software exchange.\n\n    3.2. Modifications.\n\n    The Modifications that You create or to which You contribute are\n    governed by the terms of this License. You represent that You\n    believe Your Modifications are Your original creation(s) and/or You\n    have sufficient rights to grant the rights conveyed by this License.\n\n    3.3. Required Notices.\n\n    You must include a notice in each of Your Modifications that\n    identifies You as the Contributor of the Modification. You may not\n    remove or alter any copyright, patent or trademark notices contained\n    within the Covered Software, or any notices of licensing or any\n    descriptive text giving attribution to any Contributor or the\n    Initial Developer.\n\n    3.4. Application of Additional Terms.\n\n    You may not offer or impose any terms on any Covered Software in\n    Source Code form that alters or restricts the applicable version of\n    this License or the recipients' rights hereunder. You may choose to\n    offer, and to charge a fee for, warranty, support, indemnity or\n    liability obligations to one or more recipients of Covered Software.\n    However, you may do so only on Your own behalf, and not on behalf of\n    the Initial Developer or any Contributor. You must make it\n    absolutely clear that any such warranty, support, indemnity or\n    liability obligation is offered by You alone, and You hereby agree\n    to indemnify the Initial Developer and every Contributor for any\n    liability incurred by the Initial Developer or such Contributor as a\n    result of warranty, support, indemnity or liability terms You offer.\n\n    3.5. Distribution of Executable Versions.\n\n    You may distribute the Executable form of the Covered Software under\n    the terms of this License or under the terms of a license of Your\n    choice, which may contain terms different from this License,\n    provided that You are in compliance with the terms of this License\n    and that the license for the Executable form does not attempt to\n    limit or alter the recipient's rights in the Source Code form from\n    the rights set forth in this License. If You distribute the Covered\n    Software in Executable form under a different license, You must make\n    it absolutely clear that any terms which differ from this License\n    are offered by You alone, not by the Initial Developer or\n    Contributor. You hereby agree to indemnify the Initial Developer and\n    every Contributor for any liability incurred by the Initial\n    Developer or such Contributor as a result of any such terms You offer.\n\n    3.6. Larger Works.\n\n    You may create a Larger Work by combining Covered Software with\n    other code not governed by the terms of this License and distribute\n    the Larger Work as a single product. In such a case, You must make\n    sure the requirements of this License are fulfilled for the Covered\n    Software.\n\n4. Versions of the License.\n\n    4.1. New Versions.\n\n    Oracle is the initial license steward and may publish revised and/or\n    new versions of this License from time to time. Each version will be\n    given a distinguishing version number. Except as provided in Section\n    4.3, no one other than the license steward has the right to modify\n    this License.\n\n    4.2. Effect of New Versions.\n\n    You may always continue to use, distribute or otherwise make the\n    Covered Software available under the terms of the version of the\n    License under which You originally received the Covered Software. If\n    the Initial Developer includes a notice in the Original Software\n    prohibiting it from being distributed or otherwise made available\n    under any subsequent version of the License, You must distribute and\n    make the Covered Software available under the terms of the version\n    of the License under which You originally received the Covered\n    Software. Otherwise, You may also choose to use, distribute or\n    otherwise make the Covered Software available under the terms of any\n    subsequent version of the License published by the license steward.\n\n    4.3. Modified Versions.\n\n    When You are an Initial Developer and You want to create a new\n    license for Your Original Software, You may create and use a\n    modified version of this License if You: (a) rename the license and\n    remove any references to the name of the license steward (except to\n    note that the license differs from this License); and (b) otherwise\n    make it clear that the license contains terms which differ from this\n    License.\n\n5. DISCLAIMER OF WARRANTY.\n\n    COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN \"AS IS\" BASIS,\n    WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,\n    INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE\n    IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR\n    NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF\n    THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE\n    DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY\n    OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING,\n    REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN\n    ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS\n    AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.\n\n6. TERMINATION.\n\n    6.1. This License and the rights granted hereunder will terminate\n    automatically if You fail to comply with terms herein and fail to\n    cure such breach within 30 days of becoming aware of the breach.\n    Provisions which, by their nature, must remain in effect beyond the\n    termination of this License shall survive.\n\n    6.2. If You assert a patent infringement claim (excluding\n    declaratory judgment actions) against Initial Developer or a\n    Contributor (the Initial Developer or Contributor against whom You\n    assert such claim is referred to as \"Participant\") alleging that the\n    Participant Software (meaning the Contributor Version where the\n    Participant is a Contributor or the Original Software where the\n    Participant is the Initial Developer) directly or indirectly\n    infringes any patent, then any and all rights granted directly or\n    indirectly to You by such Participant, the Initial Developer (if the\n    Initial Developer is not the Participant) and all Contributors under\n    Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice\n    from Participant terminate prospectively and automatically at the\n    expiration of such 60 day notice period, unless if within such 60\n    day period You withdraw Your claim with respect to the Participant\n    Software against such Participant either unilaterally or pursuant to\n    a written agreement with Participant.\n\n    6.3. If You assert a patent infringement claim against Participant\n    alleging that the Participant Software directly or indirectly\n    infringes any patent where such claim is resolved (such as by\n    license or settlement) prior to the initiation of patent\n    infringement litigation, then the reasonable value of the licenses\n    granted by such Participant under Sections 2.1 or 2.2 shall be taken\n    into account in determining the amount or value of any payment or\n    license.\n\n    6.4. In the event of termination under Sections 6.1 or 6.2 above,\n    all end user licenses that have been validly granted by You or any\n    distributor hereunder prior to termination (excluding licenses\n    granted to You by any distributor) shall survive termination.\n\n7. LIMITATION OF LIABILITY.\n\n    UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT\n    (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE\n    INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF\n    COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE\n    TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR\n    CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT\n    LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER\n    FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR\n    LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE\n    POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT\n    APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH\n    PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH\n    LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR\n    LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION\n    AND LIMITATION MAY NOT APPLY TO YOU.\n\n8. U.S. GOVERNMENT END USERS.\n\n    The Covered Software is a \"commercial item,\" as that term is defined\n    in 48 C.F.R. 2.101 (Oct. 1995), consisting of \"commercial computer\n    software\" (as that term is defined at 48 C.F.R. §\n    252.227-7014(a)(1)) and \"commercial computer software documentation\"\n    as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent\n    with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4\n    (June 1995), all U.S. Government End Users acquire Covered Software\n    with only those rights set forth herein. This U.S. Government Rights\n    clause is in lieu of, and supersedes, any other FAR, DFAR, or other\n    clause or provision that addresses Government rights in computer\n    software under this License.\n\n9. MISCELLANEOUS.\n\n    This License represents the complete agreement concerning subject\n    matter hereof. If any provision of this License is held to be\n    unenforceable, such provision shall be reformed only to the extent\n    necessary to make it enforceable. This License shall be governed by\n    the law of the jurisdiction specified in a notice contained within\n    the Original Software (except to the extent applicable law, if any,\n    provides otherwise), excluding such jurisdiction's conflict-of-law\n    provisions. Any litigation relating to this License shall be subject\n    to the jurisdiction of the courts located in the jurisdiction and\n    venue specified in a notice contained within the Original Software,\n    with the losing party responsible for costs, including, without\n    limitation, court costs and reasonable attorneys' fees and expenses.\n    The application of the United Nations Convention on Contracts for\n    the International Sale of Goods is expressly excluded. Any law or\n    regulation which provides that the language of a contract shall be\n    construed against the drafter shall not apply to this License. You\n    agree that You alone are responsible for compliance with the United\n    States export administration regulations (and the export control\n    laws and regulation of any other countries) when You use, distribute\n    or otherwise make available any Covered Software.\n\n10. RESPONSIBILITY FOR CLAIMS.\n\n    As between Initial Developer and the Contributors, each party is\n    responsible for claims and damages arising, directly or indirectly,\n    out of its utilization of rights under this License and You agree to\n    work with Initial Developer and Contributors to distribute such\n    responsibility on an equitable basis. Nothing herein is intended or\n    shall be deemed to constitute any admission of liability.\n\n------------------------------------------------------------------------\n\nNOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION\nLICENSE (CDDL)\n\nThe code released under the CDDL shall be governed by the laws of the\nState of California (excluding conflict-of-law provisions). Any\nlitigation relating to this License shall be subject to the jurisdiction\nof the Federal Courts of the Northern District of California and the\nstate courts of the State of California, with venue lying in Santa Clara\nCounty, California.\n\n\n\n  The GNU General Public License (GPL) Version 2, June 1991\n\nCopyright (C) 1989, 1991 Free Software Foundation, Inc.\n51 Franklin Street, Fifth Floor\nBoston, MA 02110-1335\nUSA\n\nEveryone is permitted to copy and distribute verbatim copies\nof this license document, but changing it is not allowed.\n\nPreamble\n\nThe licenses for most software are designed to take away your freedom to\nshare and change it. By contrast, the GNU General Public License is\nintended to guarantee your freedom to share and change free software--to\nmake sure the software is free for all its users. This General Public\nLicense applies to most of the Free Software Foundation's software and\nto any other program whose authors commit to using it. (Some other Free\nSoftware Foundation software is covered by the GNU Library General\nPublic License instead.) You can apply it to your programs, too.\n\nWhen we speak of free software, we are referring to freedom, not price.\nOur General Public Licenses are designed to make sure that you have the\nfreedom to distribute copies of free software (and charge for this\nservice if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs; and that you know you can do these things.\n\nTo protect your rights, we need to make restrictions that forbid anyone\nto deny you these rights or to ask you to surrender the rights. These\nrestrictions translate to certain responsibilities for you if you\ndistribute copies of the software, or if you modify it.\n\nFor example, if you distribute copies of such a program, whether gratis\nor for a fee, you must give the recipients all the rights that you have.\nYou must make sure that they, too, receive or can get the source code.\nAnd you must show them these terms so they know their rights.\n\nWe protect your rights with two steps: (1) copyright the software, and\n(2) offer you this license which gives you legal permission to copy,\ndistribute and/or modify the software.\n\nAlso, for each author's protection and ours, we want to make certain\nthat everyone understands that there is no warranty for this free\nsoftware. If the software is modified by someone else and passed on, we\nwant its recipients to know that what they have is not the original, so\nthat any problems introduced by others will not reflect on the original\nauthors' reputations.\n\nFinally, any free program is threatened constantly by software patents.\nWe wish to avoid the danger that redistributors of a free program will\nindividually obtain patent licenses, in effect making the program\nproprietary. To prevent this, we have made it clear that any patent must\nbe licensed for everyone's free use or not licensed at all.\n\nThe precise terms and conditions for copying, distribution and\nmodification follow.\n\nTERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n0. This License applies to any program or other work which contains a\nnotice placed by the copyright holder saying it may be distributed under\nthe terms of this General Public License. The \"Program\", below, refers\nto any such program or work, and a \"work based on the Program\" means\neither the Program or any derivative work under copyright law: that is\nto say, a work containing the Program or a portion of it, either\nverbatim or with modifications and/or translated into another language.\n(Hereinafter, translation is included without limitation in the term\n\"modification\".) Each licensee is addressed as \"you\".\n\nActivities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope. The act of running\nthe Program is not restricted, and the output from the Program is\ncovered only if its contents constitute a work based on the Program\n(independent of having been made by running the Program). Whether that\nis true depends on what the Program does.\n\n1. You may copy and distribute verbatim copies of the Program's source\ncode as you receive it, in any medium, provided that you conspicuously\nand appropriately publish on each copy an appropriate copyright notice\nand disclaimer of warranty; keep intact all the notices that refer to\nthis License and to the absence of any warranty; and give any other\nrecipients of the Program a copy of this License along with the Program.\n\nYou may charge a fee for the physical act of transferring a copy, and\nyou may at your option offer warranty protection in exchange for a fee.\n\n2. You may modify your copy or copies of the Program or any portion of\nit, thus forming a work based on the Program, and copy and distribute\nsuch modifications or work under the terms of Section 1 above, provided\nthat you also meet all of these conditions:\n\n    a) You must cause the modified files to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    b) You must cause any work that you distribute or publish, that in\n    whole or in part contains or is derived from the Program or any part\n    thereof, to be licensed as a whole at no charge to all third parties\n    under the terms of this License.\n\n    c) If the modified program normally reads commands interactively\n    when run, you must cause it, when started running for such\n    interactive use in the most ordinary way, to print or display an\n    announcement including an appropriate copyright notice and a notice\n    that there is no warranty (or else, saying that you provide a\n    warranty) and that users may redistribute the program under these\n    conditions, and telling the user how to view a copy of this License.\n    (Exception: if the Program itself is interactive but does not\n    normally print such an announcement, your work based on the Program\n    is not required to print an announcement.)\n\nThese requirements apply to the modified work as a whole. If\nidentifiable sections of that work are not derived from the Program, and\ncan be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works. But when you\ndistribute the same sections as part of a whole which is a work based on\nthe Program, the distribution of the whole must be on the terms of this\nLicense, whose permissions for other licensees extend to the entire\nwhole, and thus to each and every part regardless of who wrote it.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Program.\n\nIn addition, mere aggregation of another work not based on the Program\nwith the Program (or with a work based on the Program) on a volume of a\nstorage or distribution medium does not bring the other work under the\nscope of this License.\n\n3. You may copy and distribute the Program (or a work based on it,\nunder Section 2) in object code or executable form under the terms of\nSections 1 and 2 above provided that you also do one of the following:\n\n    a) Accompany it with the complete corresponding machine-readable\n    source code, which must be distributed under the terms of Sections 1\n    and 2 above on a medium customarily used for software interchange; or,\n\n    b) Accompany it with a written offer, valid for at least three\n    years, to give any third party, for a charge no more than your cost\n    of physically performing source distribution, a complete\n    machine-readable copy of the corresponding source code, to be\n    distributed under the terms of Sections 1 and 2 above on a medium\n    customarily used for software interchange; or,\n\n    c) Accompany it with the information you received as to the offer to\n    distribute corresponding source code. (This alternative is allowed\n    only for noncommercial distribution and only if you received the\n    program in object code or executable form with such an offer, in\n    accord with Subsection b above.)\n\nThe source code for a work means the preferred form of the work for\nmaking modifications to it. For an executable work, complete source code\nmeans all the source code for all modules it contains, plus any\nassociated interface definition files, plus the scripts used to control\ncompilation and installation of the executable. However, as a special\nexception, the source code distributed need not include anything that is\nnormally distributed (in either source or binary form) with the major\ncomponents (compiler, kernel, and so on) of the operating system on\nwhich the executable runs, unless that component itself accompanies the\nexecutable.\n\nIf distribution of executable or object code is made by offering access\nto copy from a designated place, then offering equivalent access to copy\nthe source code from the same place counts as distribution of the source\ncode, even though third parties are not compelled to copy the source\nalong with the object code.\n\n4. You may not copy, modify, sublicense, or distribute the Program\nexcept as expressly provided under this License. Any attempt otherwise\nto copy, modify, sublicense or distribute the Program is void, and will\nautomatically terminate your rights under this License. However, parties\nwho have received copies, or rights, from you under this License will\nnot have their licenses terminated so long as such parties remain in\nfull compliance.\n\n5. You are not required to accept this License, since you have not\nsigned it. However, nothing else grants you permission to modify or\ndistribute the Program or its derivative works. These actions are\nprohibited by law if you do not accept this License. Therefore, by\nmodifying or distributing the Program (or any work based on the\nProgram), you indicate your acceptance of this License to do so, and all\nits terms and conditions for copying, distributing or modifying the\nProgram or works based on it.\n\n6. Each time you redistribute the Program (or any work based on the\nProgram), the recipient automatically receives a license from the\noriginal licensor to copy, distribute or modify the Program subject to\nthese terms and conditions. You may not impose any further restrictions\non the recipients' exercise of the rights granted herein. You are not\nresponsible for enforcing compliance by third parties to this License.\n\n7. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot distribute\nso as to satisfy simultaneously your obligations under this License and\nany other pertinent obligations, then as a consequence you may not\ndistribute the Program at all. For example, if a patent license would\nnot permit royalty-free redistribution of the Program by all those who\nreceive copies directly or indirectly through you, then the only way you\ncould satisfy both it and this License would be to refrain entirely from\ndistribution of the Program.\n\nIf any portion of this section is held invalid or unenforceable under\nany particular circumstance, the balance of the section is intended to\napply and the section as a whole is intended to apply in other\ncircumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system, which is implemented\nby public license practices. Many people have made generous\ncontributions to the wide range of software distributed through that\nsystem in reliance on consistent application of that system; it is up to\nthe author/donor to decide if he or she is willing to distribute\nsoftware through any other system and a licensee cannot impose that choice.\n\nThis section is intended to make thoroughly clear what is believed to be\na consequence of the rest of this License.\n\n8. If the distribution and/or use of the Program is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Program under this License may\nadd an explicit geographical distribution limitation excluding those\ncountries, so that distribution is permitted only in or among countries\nnot thus excluded. In such case, this License incorporates the\nlimitation as if written in the body of this License.\n\n9. The Free Software Foundation may publish revised and/or new\nversions of the General Public License from time to time. Such new\nversions will be similar in spirit to the present version, but may\ndiffer in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number. If the Program\nspecifies a version number of this License which applies to it and \"any\nlater version\", you have the option of following the terms and\nconditions either of that version or of any later version published by\nthe Free Software Foundation. If the Program does not specify a version\nnumber of this License, you may choose any version ever published by the\nFree Software Foundation.\n\n10. If you wish to incorporate parts of the Program into other free\nprograms whose distribution conditions are different, write to the\nauthor to ask for permission. For software which is copyrighted by the\nFree Software Foundation, write to the Free Software Foundation; we\nsometimes make exceptions for this. Our decision will be guided by the\ntwo goals of preserving the free status of all derivatives of our free\nsoftware and of promoting the sharing and reuse of software generally.\n\nNO WARRANTY\n\n11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO\nWARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\nOTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND,\nEITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE\nENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH\nYOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL\nNECESSARY SERVICING, REPAIR OR CORRECTION.\n\n12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\nAND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR\nDAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL\nDAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM\n(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED\nINACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF\nTHE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR\nOTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n\nEND OF TERMS AND CONDITIONS\n\nHow to Apply These Terms to Your New Programs\n\nIf you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\nTo do so, attach the following notices to the program. It is safest to\nattach them to the start of each source file to most effectively convey\nthe exclusion of warranty; and each file should have at least the\n\"copyright\" line and a pointer to where the full notice is found.\n\n    One line to give the program's name and a brief idea of what it does.\n    Copyright (C) <year> <name of author>\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful, but\n    WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n    General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA\n\nAlso add information on how to contact you by electronic and paper mail.\n\nIf the program is interactive, make it output a short notice like this\nwhen it starts in an interactive mode:\n\n    Gnomovision version 69, Copyright (C) year name of author\n    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type\n    `show w'. This is free software, and you are welcome to redistribute\n    it under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the\nappropriate parts of the General Public License. Of course, the commands\nyou use may be called something other than `show w' and `show c'; they\ncould even be mouse-clicks or menu items--whatever suits your program.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the program, if\nnecessary. Here is a sample; alter the names:\n\n    Yoyodyne, Inc., hereby disclaims all copyright interest in the\n    program `Gnomovision' (which makes passes at compilers) written by\n    James Hacker.\n\n    signature of Ty Coon, 1 April 1989\n    Ty Coon, President of Vice\n\nThis General Public License does not permit incorporating your program\ninto proprietary programs. If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications\nwith the library. If this is what you want to do, use the GNU Library\nGeneral Public License instead of this License.\n\n#\n\nCertain source files distributed by Oracle America, Inc. and/or its\naffiliates are subject to the following clarification and special\nexception to the GPLv2, based on the GNU Project exception for its\nClasspath libraries, known as the GNU Classpath Exception, but only\nwhere Oracle has expressly included in the particular source file's\nheader the words \"Oracle designates this particular file as subject to\nthe \"Classpath\" exception as provided by Oracle in the LICENSE file\nthat accompanied this code.\"\n\nYou should also note that Oracle includes multiple, independent\nprograms in this software package. Some of those programs are provided\nunder licenses deemed incompatible with the GPLv2 by the Free Software\nFoundation and others.  For example, the package includes programs\nlicensed under the Apache License, Version 2.0.  Such programs are\nlicensed to you under their original licenses.\n\nOracle facilitates your further distribution of this package by adding\nthe Classpath Exception to the necessary parts of its GPLv2 code, which\npermits you to use that code in combination with other independent\nmodules not licensed under the GPLv2.  However, note that this would\nnot permit you to commingle code under an incompatible license with\nOracle's GPLv2 licensed code by, for example, cutting and pasting such\ncode into a file also containing Oracle's GPLv2 licensed code and then\ndistributing the result.  Additionally, if you were to remove the\nClasspath Exception from any of the files to which it applies and\ndistribute the result, you would likely be required to license some or\nall of the other code in that distribution under the GPLv2 as well, and\nsince the GPLv2 is incompatible with the license terms of some items\nincluded in the distribution by Oracle, removing the Classpath\nException could therefore effectively compromise your ability to\nfurther distribute the package.\n\nProceed with caution and we recommend that you obtain the advice of a\nlawyer skilled in open source matters before removing the Classpath\nException or making modifications to this package which may\nsubsequently be redistributed and/or involve the use of third party\nsoftware.\n\nCLASSPATH EXCEPTION\nLinking this library statically or dynamically with other modules is\nmaking a combined work based on this library.  Thus, the terms and\nconditions of the GNU General Public License version 2 cover the whole\ncombination.\n\nAs a special exception, the copyright holders of this library give you\npermission to link this library with independent modules to produce an\nexecutable, regardless of the license terms of these independent\nmodules, and to copy and distribute the resulting executable under\nterms of your choice, provided that you also meet, for each linked\nindependent module, the terms and conditions of the license of that\nmodule.  An independent module is a module which is not derived from or\nbased on this library.  If you modify this library, you may extend this\nexception to your version of the library, but you are not obligated to\ndo so.  If you do not wish to do so, delete this exception statement\nfrom your version.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-commonmark",
    "content": "Copyright (c) 2015-2016, Atlassian Pty Ltd\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-epl-v10",
    "content": "Eclipse Public License - v 1.0\nTHE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (\"AGREEMENT\"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.\n\n1. DEFINITIONS\n\n\"Contribution\" means:\n\na) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and\n\nb) in the case of each subsequent Contributor:\n\ni) changes to the Program, and\n\nii) additions to the Program;\n\nwhere such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.\n\n\"Contributor\" means any person or entity that distributes the Program.\n\n\"Licensed Patents\" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.\n\n\"Program\" means the Contributions distributed in accordance with this Agreement.\n\n\"Recipient\" means anyone who receives the Program under this Agreement, including all Contributors.\n\n2. GRANT OF RIGHTS\n\na) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.\n\nb) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.\n\nc) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.\n\nd) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.\n\n3. REQUIREMENTS\n\nA Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:\n\na) it complies with the terms and conditions of this Agreement; and\n\nb) its license agreement:\n\ni) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;\n\nii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;\n\niii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and\n\niv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.\n\nWhen the Program is made available in source code form:\n\na) it must be made available under this Agreement; and\n\nb) a copy of this Agreement must be included with each copy of the Program.\n\nContributors may not remove or alter any copyright notices contained within the Program.\n\nEach Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.\n\n4. COMMERCIAL DISTRIBUTION\n\nCommercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (\"Commercial Contributor\") hereby agrees to defend and indemnify every other Contributor (\"Indemnified Contributor\") against any losses, damages and costs (collectively \"Losses\") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.\n\nFor example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.\n\n5. NO WARRANTY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.\n\n6. DISCLAIMER OF LIABILITY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n\n7. GENERAL\n\nIf any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.\n\nIf Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.\n\nAll Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.\n\nEveryone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.\n\nThis Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation."
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-hamcrest",
    "content": "BSD License\n\nCopyright (c) 2000-2015 www.hamcrest.org\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of\nconditions and the following disclaimer. Redistributions in binary form must reproduce\nthe above copyright notice, this list of conditions and the following disclaimer in\nthe documentation and/or other materials provided with the distribution.\n\nNeither the name of Hamcrest nor the names of its contributors may be used to endorse\nor promote products derived from this software without specific prior written\npermission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT\nSHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\nBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY\nWAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGE.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-jmustache",
    "content": "Copyright (c) 2010, Michael Bayne\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n    * The name Michael Bayne may not be used to endorse or promote products\n      derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-jopt",
    "content": "The MIT License\n\nCopyright (c) 2004-2016 Paul R. Holser, Jr.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-jsch",
    "content": "JSch 0.0.* was released under the GNU LGPL license.  Later, we have switched \nover to a BSD-style license. \n\n------------------------------------------------------------------------------\nCopyright (c) 2002-2015 Atsuhiko Yamanaka, JCraft,Inc. \nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n  1. Redistributions of source code must retain the above copyright notice,\n     this list of conditions and the following disclaimer.\n\n  2. Redistributions in binary form must reproduce the above copyright \n     notice, this list of conditions and the following disclaimer in \n     the documentation and/or other materials provided with the distribution.\n\n  3. The names of the authors may not be used to endorse or promote products\n     derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\nINCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\nINC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\nOR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-jzlib",
    "content": "JZlib 0.0.* were released under the GNU LGPL license.  Later, we have switched \nover to a BSD-style license. \n\n------------------------------------------------------------------------------\nCopyright (c) 2000-2011 ymnk, JCraft,Inc. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n  1. Redistributions of source code must retain the above copyright notice,\n     this list of conditions and the following disclaimer.\n\n  2. Redistributions in binary form must reproduce the above copyright \n     notice, this list of conditions and the following disclaimer in \n     the documentation and/or other materials provided with the distribution.\n\n  3. The names of the authors may not be used to endorse or promote products\n     derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\nINCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\nINC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\nOR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-lombok",
    "content": "Copyright (C) 2009-2015 The Project Lombok Authors.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-mit",
    "content": "MIT License\n\nCopyright (c)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-mockito",
    "content": "The MIT License\n\nCopyright (c) 2007 Mockito contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-mozilla-v20",
    "content": "Mozilla Public License\nVersion 2.0\n1. Definitions\n1.1. “Contributor”\nmeans each individual or legal entity that creates, contributes to the creation of, or owns Covered Software.\n\n1.2. “Contributor Version”\nmeans the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution.\n\n1.3. “Contribution”\nmeans Covered Software of a particular Contributor.\n\n1.4. “Covered Software”\nmeans Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof.\n\n1.5. “Incompatible With Secondary Licenses”\nmeans\n\nthat the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or\n\nthat the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License.\n\n1.6. “Executable Form”\nmeans any form of the work other than Source Code Form.\n\n1.7. “Larger Work”\nmeans a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software.\n\n1.8. “License”\nmeans this document.\n\n1.9. “Licensable”\nmeans having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License.\n\n1.10. “Modifications”\nmeans any of the following:\n\nany file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or\n\nany new file in Source Code Form that contains any Covered Software.\n\n1.11. “Patent Claims” of a Contributor\nmeans any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version.\n\n1.12. “Secondary License”\nmeans either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses.\n\n1.13. “Source Code Form”\nmeans the form of the work preferred for making modifications.\n\n1.14. “You” (or “Your”)\nmeans an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.\n\n2. License Grants and Conditions\n2.1. Grants\nEach Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:\n\nunder intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and\n\nunder Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.\n\n2.2. Effective Date\nThe licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution.\n\n2.3. Limitations on Grant Scope\nThe licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor:\n\nfor any code that a Contributor has removed from Covered Software; or\n\nfor infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or\n\nunder Patent Claims infringed by Covered Software in the absence of its Contributions.\n\nThis License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4).\n\n2.4. Subsequent Licenses\nNo Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3).\n\n2.5. Representation\nEach Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License.\n\n2.6. Fair Use\nThis License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents.\n\n2.7. Conditions\nSections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1.\n\n3. Responsibilities\n3.1. Distribution of Source Form\nAll distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form.\n\n3.2. Distribution of Executable Form\nIf You distribute Covered Software in Executable Form then:\n\nsuch Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and\n\nYou may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License.\n\n3.3. Distribution of a Larger Work\nYou may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s).\n\n3.4. Notices\nYou may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies.\n\n3.5. Application of Additional Terms\nYou may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction.\n\n4. Inability to Comply Due to Statute or Regulation\nIf it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.\n\n5. Termination\n5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice.\n\n5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate.\n\n5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination.\n\n6. Disclaimer of Warranty\nCovered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer.\n\n7. Limitation of Liability\nUnder no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.\n\n8. Litigation\nAny litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims.\n\n9. Miscellaneous\nThis License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor.\n\n10. Versions of the License\n10.1. New Versions\nMozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number.\n\n10.2. Effect of New Versions\nYou may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward.\n\n10.3. Modified Versions\nIf you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License).\n\n10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses\nIf You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached.\n\nExhibit A - Source Code Form License Notice\nThis Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\nIf it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.\n\nYou may add additional accurate notices of copyright ownership.\n\nExhibit B - “Incompatible With Secondary Licenses” Notice\nThis Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-slf4j",
    "content": "Copyright (c) 2004-2017 QOS.ch\nAll rights reserved.\n\nPermission is hereby granted, free  of charge, to any person obtaining\na  copy  of this  software  and  associated  documentation files  (the\n\"Software\"), to  deal in  the Software without  restriction, including\nwithout limitation  the rights to  use, copy, modify,  merge, publish,\ndistribute,  sublicense, and/or sell  copies of  the Software,  and to\npermit persons to whom the Software  is furnished to do so, subject to\nthe following conditions:\n\nThe  above  copyright  notice  and  this permission  notice  shall  be\nincluded in all copies or substantial portions of the Software.\n\nTHE  SOFTWARE IS  PROVIDED  \"AS  IS\", WITHOUT  WARRANTY  OF ANY  KIND,\nEXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF\nMERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-threetenbp",
    "content": "/*\n * Copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n *  * Redistributions of source code must retain the above copyright notice,\n *    this list of conditions and the following disclaimer.\n *\n *  * Redistributions in binary form must reproduce the above copyright notice,\n *    this list of conditions and the following disclaimer in the documentation\n *    and/or other materials provided with the distribution.\n *\n *  * Neither the name of JSR-310 nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-webjars",
    "content": "MIT License\n\nCopyright (c) 2017 James Ward\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/LICENSE-woodstox-stax2-api",
    "content": "This copy of Stax2 API is licensed under the\nSimplified BSF License (also known as \"2-clause BSD\", or \"FreeBSD License\")\nSee the License for details about distribution rights, and the\nspecific rights regarding derivate works.\n\nYou may obtain a copy of the License at:\n\nhttp://www.opensource.org/licenses/bsd-license.php\n\nwith details of:\n\n<OWNER> = FasterXML.com\n<YEAR> = 2010-\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/NOTICE-airline",
    "content": "Copyright Notices\nCopyright 2011 Dain Sundstrom dain@iq80.com Copyright 2010 Cedric Beust cedric@beust.com"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/NOTICE-apache-commons-cli",
    "content": "Apache Commons CLI\nCopyright 2001-2019 The Apache Software Foundation\n\nThis product includes software developed at\nThe Apache Software Foundation (http://www.apache.org/)."
  },
  {
    "path": "toolkit-distribution/src/release/licenses/NOTICE-apache-commons-codec",
    "content": "Apache Commons Codec\nCopyright 2002-2017 The Apache Software Foundation\n\nThis product includes software developed at\nThe Apache Software Foundation (http://www.apache.org/).\n\nsrc/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java\ncontains test data from http://aspell.net/test/orig/batch0.tab.\nCopyright (C) 2002 Kevin Atkinson (kevina@gnu.org)\n\n===============================================================================\n\nThe content of package org.apache.commons.codec.language.bm has been translated\nfrom the original php source code available at http://stevemorse.org/phoneticinfo.htm\nwith permission from the original authors.\nOriginal source copyright:\nCopyright (c) 2008 Alexander Beider & Stephen P. Morse.\n"
  },
  {
    "path": "toolkit-distribution/src/release/licenses/NOTICE-servicecomb-java-chassis",
    "content": "Apache ServiceComb Java Chassis\nCopyright 2017-2019 The Apache Software Foundation\n\nThis product includes software developed at\nThe Apache Software Foundation (http://www.apache.org/)."
  },
  {
    "path": "toolkit-maven-plugin/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <parent>\n    <artifactId>toolkit</artifactId>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <modelVersion>4.0.0</modelVersion>\n  <packaging>maven-plugin</packaging>\n  <artifactId>toolkit-maven-plugin</artifactId>\n  \n  <dependencies>\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>docgen</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>contractgen</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>codegen</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.maven</groupId>\n      <artifactId>maven-plugin-api</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.maven.plugin-tools</groupId>\n      <artifactId>maven-plugin-annotations</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.maven.plugin-tools</groupId>\n      <artifactId>maven-plugin-tools-annotations</artifactId>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.maven</groupId>\n      <artifactId>maven-core</artifactId>\n      <exclusions>\n        <exclusion>\n          <groupId>org.checkerframework</groupId>\n          <artifactId>checker-compat-qual</artifactId>\n        </exclusion>\n      </exclusions>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.servicecomb.toolkit</groupId>\n      <artifactId>common</artifactId>\n    </dependency>\n\n    <!-- for test -->\n    <dependency>\n      <groupId>junit</groupId>\n      <artifactId>junit</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.maven.plugin-testing</groupId>\n      <artifactId>maven-plugin-testing-harness</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.maven</groupId>\n      <artifactId>maven-aether-provider</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.apache.maven</groupId>\n      <artifactId>maven-compat</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.powermock</groupId>\n      <artifactId>powermock-module-junit4</artifactId>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>org.powermock</groupId>\n      <artifactId>powermock-api-mockito</artifactId>\n      <scope>test</scope>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <plugins>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n      </plugin>\n\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-plugin-plugin</artifactId>\n        <configuration>\n          <goalPrefix>toolkit</goalPrefix>\n          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>\n        </configuration>\n        <executions>\n          <execution>\n            <id>generate-descriptor</id>\n            <goals>\n              <goal>descriptor</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n\n\n</project>\n"
  },
  {
    "path": "toolkit-maven-plugin/src/main/java/org/apache/servicecomb/toolkit/plugin/GenerateMojo.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.plugin;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.Optional;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.maven.plugin.AbstractMojo;\nimport org.apache.maven.plugins.annotations.Execute;\nimport org.apache.maven.plugins.annotations.LifecyclePhase;\nimport org.apache.maven.plugins.annotations.Mojo;\nimport org.apache.maven.plugins.annotations.Parameter;\nimport org.apache.maven.plugins.annotations.ResolutionScope;\nimport org.apache.maven.project.MavenProject;\nimport org.apache.servicecomb.toolkit.codegen.GeneratorExternalConfigConstant;\nimport org.apache.servicecomb.toolkit.codegen.ServiceType;\nimport org.apache.servicecomb.toolkit.common.FileUtils;\nimport org.apache.servicecomb.toolkit.common.SourceType;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n@Mojo(name = \"generate\", defaultPhase = LifecyclePhase.COMPILE, requiresDependencyResolution = ResolutionScope.COMPILE, aggregator = true)\n@Execute(goal = \"generate\", phase = LifecyclePhase.COMPILE)\npublic class GenerateMojo extends AbstractMojo {\n\n  private static Logger LOGGER = LoggerFactory.getLogger(GenerateMojo.class);\n\n  private String providerProjectNameSuffix = \"-provider\";\n\n  private String consumerProjectNameSuffix = \"-consumer\";\n\n  private String modelProjectNameSuffix = \"-model\";\n\n  @Parameter(defaultValue = \"${project}\")\n  private MavenProject project;\n\n  @Parameter(defaultValue = \"code\")\n  private String sourceType;\n\n  @Parameter(defaultValue = \"yaml\")\n  private String contractFileType;\n\n  @Parameter(defaultValue = \"html\")\n  private String documentType;\n\n  @Parameter\n  private String contractLocation;\n\n  @Parameter(defaultValue = \"./target\")\n  private String outputDirectory;\n\n  @Parameter\n  private ServiceConfig service;\n\n  /**\n   * A map of additional properties that can be referenced by the mustache templates\n   * <additionalProperties>\n   *     <prop1>value</prop1>\n   *     <prop2>value</prop2>\n   *     ...\n   * </additionalProperties>\n   */\n  @Parameter\n  private Map<String, Object> additionalProperties;\n\n  @Override\n  public void execute() {\n\n    checkConfig();\n\n    if (MavenPluginUtil.isParentProject(project)) {\n      for (MavenProject subProject : project.getCollectedProjects()) {\n        generateContract(subProject);\n        generateDocument(subProject);\n      }\n      generateContract(project);\n      generateDocument(project);\n      generateCode(project);\n    } else {\n      generateContract(project);\n      generateDocument(project);\n      generateCode(project);\n    }\n  }\n\n  private void checkConfig() {\n    Optional.ofNullable(service).ifPresent(service -> {\n      if (service.getServiceType().equalsIgnoreCase(ServiceType.CONSUMER.name())) {\n        if (StringUtils.isEmpty(service.getProviderServiceId())) {\n          throw new IllegalArgumentException(\"In consumer type, providerServiceId is required\");\n        }\n      }\n    });\n  }\n\n  private void generateContract(MavenProject project) {\n\n    switch (SourceType.valueOf(sourceType.toUpperCase())) {\n      case CODE:\n        // generate contract file\n        String contractOutput =\n            outputDirectory + File.separator + \"contract\" + File.separator + project.getBasedir().getName();\n        try {\n          FileUtils.createDirectory(contractOutput);\n        } catch (IOException e) {\n          throw new RuntimeException(\"Failed to generate contract\", e);\n        }\n\n        GenerateUtil.generateContract(project, contractOutput, contractFileType, \"default\");\n        contractLocation = outputDirectory + File.separator + \"contract\";\n        if (Objects.requireNonNull(new File(contractOutput).listFiles()).length == 0) {\n          //noinspection ResultOfMethodCallIgnored\n          new File(contractOutput).delete();\n          LOGGER.info(\"No contract in the code\");\n          return;\n        }\n\n        break;\n      case CONTRACT:\n        if (contractLocation == null) {\n          throw new RuntimeException(\"Invalid or not config contract location\");\n        }\n\n        if (!new File(contractLocation).exists()) {\n          throw new RuntimeException(\"Contract path \" + contractLocation + \" is not exists\");\n        }\n\n        break;\n      default:\n        throw new RuntimeException(\"Not support source type \" + sourceType);\n    }\n  }\n\n  private void generateCode(MavenProject project) {\n    //generate microservice project\n    if (service == null) {\n      LOGGER.info(\"Cannot generate code without service configuration\");\n    } else {\n      String codeOutput =\n          outputDirectory + File.separator + \"project\" + File.separator;\n      try {\n        FileUtils.createDirectory(codeOutput);\n        Map<String, Object> externalConfig = Optional.ofNullable(additionalProperties).orElse(new HashMap<>());\n        externalConfig.put(GeneratorExternalConfigConstant.PROVIDER_PROJECT_NAME,\n            project.getBasedir().getName() + providerProjectNameSuffix);\n        externalConfig.put(GeneratorExternalConfigConstant.CONSUMER_PROJECT_NAME,\n            project.getBasedir().getName() + consumerProjectNameSuffix);\n        externalConfig.put(GeneratorExternalConfigConstant.MODEL_PROJECT_NAME,\n            project.getBasedir().getName() + modelProjectNameSuffix);\n        GenerateUtil.generateCode(service, contractLocation, codeOutput, externalConfig, \"default\");\n      } catch (RuntimeException | IOException e) {\n        throw new RuntimeException(\"Failed to generate code\", e);\n      }\n    }\n  }\n\n  private void generateDocument(MavenProject project) {\n\n    //generate document\n    String documentOutput =\n        outputDirectory + File.separator + \"document\";\n    try {\n      FileUtils.createDirectory(documentOutput);\n      GenerateUtil.generateDocument(contractLocation, documentOutput, \"default\");\n    } catch (RuntimeException | IOException e) {\n      throw new RuntimeException(\"Failed to generate document\", e);\n    }\n  }\n}\n"
  },
  {
    "path": "toolkit-maven-plugin/src/main/java/org/apache/servicecomb/toolkit/plugin/GenerateUtil.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.plugin;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.FileVisitResult;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.nio.file.SimpleFileVisitor;\nimport java.nio.file.attribute.BasicFileAttributes;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.Optional;\n\nimport org.apache.maven.artifact.DependencyResolutionRequiredException;\nimport org.apache.maven.project.MavenProject;\nimport org.apache.servicecomb.toolkit.CodeGenerator;\nimport org.apache.servicecomb.toolkit.ContractsGenerator;\nimport org.apache.servicecomb.toolkit.DocGenerator;\nimport org.apache.servicecomb.toolkit.GeneratorFactory;\nimport org.apache.servicecomb.toolkit.codegen.GeneratorExternalConfigConstant;\nimport org.apache.servicecomb.toolkit.codegen.MicroServiceFramework;\nimport org.apache.servicecomb.toolkit.codegen.ProjectMetaConstant;\nimport org.openapitools.codegen.config.CodegenConfigurator;\n\nimport io.swagger.parser.OpenAPIParser;\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.parser.core.models.SwaggerParseResult;\n\nclass GenerateUtil {\n\n  private static String providerProjectNameSuffix = \"-provider\";\n\n  private static String consumerProjectNameSuffix = \"-consumer\";\n\n  private static String modelProjectNameSuffix = \"-model\";\n\n  public static void generateContract(MavenProject project, String contractOutput, String contractFileType,\n      String type) {\n\n    Map<String, Object> contractConfig = new HashMap<>();\n    try {\n      contractConfig.put(\"classpathUrls\", project.getRuntimeClasspathElements());\n    } catch (DependencyResolutionRequiredException e) {\n      throw new RuntimeException(\"Failed to get runtime class elements\", e);\n    }\n    contractConfig.put(\"outputDir\", contractOutput);\n    contractConfig.put(\"contractFileType\", contractFileType);\n\n    // TODO: support users to addParamCtx other getGenerator type soon\n    ContractsGenerator contractGenerator = GeneratorFactory.getGenerator(ContractsGenerator.class, type);\n    Objects.requireNonNull(contractGenerator).configure(contractConfig);\n\n    contractGenerator.generate();\n  }\n\n  static void generateDocument(String contractLocation, String documentOutput, String type) throws IOException {\n\n    // TODO: support users to addParamCtx other getGenerator type soon\n    DocGenerator docGenerator = GeneratorFactory.getGenerator(DocGenerator.class, type);\n    if (docGenerator == null) {\n      throw new RuntimeException(\"Cannot found document generator's implementation\");\n    }\n\n    Files.walkFileTree(Paths.get(contractLocation), new SimpleFileVisitor<Path>() {\n\n      @Override\n      public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n\n        if (Files.isDirectory(file)) {\n          return super.visitFile(file, attrs);\n        }\n        Map<String, Object> docGeneratorConfig = new HashMap<>();\n\n        SwaggerParseResult swaggerParseResult = new OpenAPIParser()\n            .readLocation(file.toUri().toURL().toString(), null, null);\n        OpenAPI openAPI = swaggerParseResult.getOpenAPI();\n        if (openAPI == null) {\n          return super.visitFile(file, attrs);\n        }\n        docGeneratorConfig.put(\"contractContent\", openAPI);\n        docGeneratorConfig.put(\"outputPath\",\n            documentOutput + File.separator + file.getParent().toFile().getName() + File.separator + file.toFile()\n                .getName()\n                .substring(0, file.toFile().getName().indexOf(\".\")));\n\n        docGenerator.configure(docGeneratorConfig);\n        docGenerator.generate();\n\n        return super.visitFile(file, attrs);\n      }\n    });\n  }\n\n  static void generateCode(ServiceConfig service, String contractLocation,\n      String codeOutput, Map<String, Object> externalConfig, String type) throws IOException {\n    CodeGenerator codeGenerator = GeneratorFactory.getGenerator(CodeGenerator.class, type);\n    if (codeGenerator == null) {\n      throw new RuntimeException(\"Cannot found code generator's implementation\");\n    }\n\n    File contractFile = new File(contractLocation);\n    if (contractFile.isDirectory()) {\n\n      List<CodegenConfigurator> configurators = new ArrayList<>();\n      Files.walkFileTree(Paths.get(contractFile.toURI()), new SimpleFileVisitor<Path>() {\n        @Override\n        public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n          if (Files.isDirectory(file)) {\n            return super.visitFile(file, attrs);\n          }\n\n          CodegenConfigurator configurator = new CodegenConfigurator();\n          commonConfig(configurator, service);\n          configurator.setOutputDir(codeOutput)\n              .addAdditionalProperty(GeneratorExternalConfigConstant.PROVIDER_PROJECT_NAME,\n                  file.getParent().getFileName() + providerProjectNameSuffix)\n              .addAdditionalProperty(GeneratorExternalConfigConstant.CONSUMER_PROJECT_NAME,\n                  file.getParent().getFileName() + consumerProjectNameSuffix)\n              .addAdditionalProperty(GeneratorExternalConfigConstant.MODEL_PROJECT_NAME,\n                  file.getParent().getFileName() + modelProjectNameSuffix)\n              .addAdditionalProperty(\"apiName\", file.toFile().getName().split(\"\\\\.\")[0])\n              .addAdditionalProperty(\"microserviceName\", file.getParent().getFileName().toString());\n\n          configurator.setInputSpec(file.toFile().getCanonicalPath());\n          configurators.add(configurator);\n          return super.visitFile(file, attrs);\n        }\n      });\n\n      Objects.requireNonNull(codeGenerator).configure(Collections.singletonMap(\"configurators\", configurators));\n      codeGenerator.generate();\n    } else {\n\n      CodegenConfigurator configurator = new CodegenConfigurator();\n      commonConfig(configurator, service);\n      configurator.setOutputDir(codeOutput)\n          .addAdditionalProperty(GeneratorExternalConfigConstant.PROVIDER_PROJECT_NAME,\n              contractFile.getParentFile().getName() + providerProjectNameSuffix)\n          .addAdditionalProperty(GeneratorExternalConfigConstant.CONSUMER_PROJECT_NAME,\n              contractFile.getParentFile().getName() + consumerProjectNameSuffix)\n          .addAdditionalProperty(GeneratorExternalConfigConstant.MODEL_PROJECT_NAME,\n              contractFile.getParentFile().getName() + modelProjectNameSuffix)\n          .addAdditionalProperty(\"apiName\", contractFile.getName().split(\"\\\\.\")[0])\n          .addAdditionalProperty(\"microserviceName\", contractFile.getParentFile().getName());\n\n      configurator.setInputSpec(contractLocation);\n      Objects.requireNonNull(codeGenerator)\n          .configure(Collections.singletonMap(\"configurators\", Collections.singletonList(configurator)));\n      codeGenerator.generate();\n    }\n  }\n\n  private static void commonConfig(CodegenConfigurator configurator, ServiceConfig service) {\n\n    configurator\n        .setGeneratorName(service.getMicroServiceFramework())\n        .setGroupId(service.getGroupId())\n        .setArtifactId(service.getArtifactId())\n        .setModelPackage(service.getPackageName())\n        .addAdditionalProperty(\"mainClassPackage\", Optional.ofNullable(service.getPackageName()).orElse(\"\"))\n        .setArtifactVersion(service.getArtifactVersion())\n        .addAdditionalProperty(ProjectMetaConstant.SERVICE_TYPE,\n            Optional.ofNullable(service.getServiceType()).orElse(\"all\"))\n        .addAdditionalProperty(ProjectMetaConstant.SERVICE_ID, service.getServiceId());\n\n    Optional.ofNullable(service.getProviderServiceId()).ifPresent(providerServiceId -> configurator\n        .addAdditionalProperty(ProjectMetaConstant.PROVIDER_SERVICE_ID, service.getProviderServiceId()));\n\n    if (MicroServiceFramework.SERVICECOMB.name().equalsIgnoreCase(service.getMicroServiceFramework())) {\n      configurator.setLibrary(service.getProgrammingModel());\n    }\n\n    configurator.setApiPackage(\n        Optional.ofNullable(service.getApiPackage()).orElse(String.format(\"%s.api\", service.getPackageName())));\n    configurator.setModelPackage(\n        Optional.ofNullable(service.getModelPackage()).orElse(String.format(\"%s.model\", service.getPackageName())));\n  }\n}\n"
  },
  {
    "path": "toolkit-maven-plugin/src/main/java/org/apache/servicecomb/toolkit/plugin/MavenPluginUtil.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.plugin;\n\nimport org.apache.maven.project.MavenProject;\n\npublic class MavenPluginUtil {\n\n  private static final String PARENT_PROJECT_PACKAGING = \"pom\";\n\n  public static boolean isParentProject(MavenProject project){\n    return PARENT_PROJECT_PACKAGING.equals(project.getPackaging());\n  }\n\n}\n"
  },
  {
    "path": "toolkit-maven-plugin/src/main/java/org/apache/servicecomb/toolkit/plugin/ServiceConfig.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.plugin;\n\nimport org.apache.commons.lang3.StringUtils;\n\npublic class ServiceConfig {\n\n  private String serviceType = \"all\";\n\n  private String groupId = \"domain.orgnization.project\";\n\n  private String artifactId = \"sample\";\n\n  private String artifactVersion = \"0.1.0-SNAPSHOT\";\n\n  private String packageName = \"domain.orgnization.project.sample\";\n\n  private String programmingModel = \"SpringMVC\";\n\n  private String microServiceFramework = \"ServiceComb\";\n\n  // only for consumer\n  private String providerServiceId;\n\n  private String serviceId;\n\n  private String apiPackage;\n\n  private String modelPackage;\n\n  public String getServiceType() {\n    return serviceType;\n  }\n\n  public String getGroupId() {\n    return groupId;\n  }\n\n  public String getArtifactId() {\n    return artifactId;\n  }\n\n  public String getArtifactVersion() {\n    return artifactVersion;\n  }\n\n  public String getPackageName() {\n    return packageName;\n  }\n\n  public String getProgrammingModel() {\n    return programmingModel;\n  }\n\n  public String getMicroServiceFramework() {\n    return microServiceFramework;\n  }\n\n  public String getProviderServiceId() {\n    return providerServiceId;\n  }\n\n  public String getServiceId() {\n    // Default, serviceId equals artifactId\n    if (StringUtils.isEmpty(serviceId) && StringUtils.isNotEmpty(artifactId)) {\n      serviceId = artifactId;\n    }\n    return serviceId;\n  }\n\n  public String getApiPackage() {\n    return apiPackage;\n  }\n\n  public String getModelPackage() {\n    return modelPackage;\n  }\n}\n"
  },
  {
    "path": "toolkit-maven-plugin/src/main/java/org/apache/servicecomb/toolkit/plugin/VerifyMojo.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.plugin;\n\nimport java.io.IOException;\nimport java.util.Map;\n\nimport org.apache.maven.plugin.AbstractMojo;\nimport org.apache.maven.plugins.annotations.Execute;\nimport org.apache.maven.plugins.annotations.LifecyclePhase;\nimport org.apache.maven.plugins.annotations.Mojo;\nimport org.apache.maven.plugins.annotations.Parameter;\nimport org.apache.maven.plugins.annotations.ResolutionScope;\nimport org.apache.maven.project.MavenProject;\nimport org.apache.servicecomb.toolkit.common.ContractComparator;\nimport org.apache.servicecomb.toolkit.common.FileUtils;\nimport org.apache.servicecomb.toolkit.common.SourceType;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n@Mojo(name = \"verify\", defaultPhase = LifecyclePhase.COMPILE, requiresDependencyResolution = ResolutionScope.COMPILE)\n@Execute(goal = \"verify\", phase = LifecyclePhase.COMPILE)\npublic class VerifyMojo extends AbstractMojo {\n\n  private final static Logger LOGGER = LoggerFactory.getLogger(VerifyMojo.class);\n\n  @Parameter(defaultValue = \"${project}\", required = true, readonly = true)\n  private MavenProject project;\n\n  @Parameter(defaultValue = \"code\")\n  private String sourceType;\n\n  @Parameter\n  private String sourceContractPath;\n\n  @Parameter\n  private String destinationContractPath;\n\n\n  @Override\n  public void execute() {\n\n    String contractFileType = \"yaml\";\n\n    switch (SourceType.valueOf(sourceType.toUpperCase())) {\n      case CODE:\n        try {\n          sourceContractPath = FileUtils.createTempDirectory(\"target/tmp-contract\").toFile().getCanonicalPath();\n          GenerateUtil.generateContract(project, sourceContractPath, contractFileType, \"default\");\n        } catch (RuntimeException | IOException e) {\n          throw new RuntimeException(\"Failed to generate contract from code\", e);\n        }\n\n        break;\n      case CONTRACT:\n\n        break;\n      default:\n        throw new RuntimeException(\"Not support source type \" + sourceType);\n    }\n\n    try {\n      Map<String, byte[]> sourceContractGroup = FileUtils.getFilesGroupByFilename(sourceContractPath);\n      Map<String, byte[]> destinationContractGroup = FileUtils.getFilesGroupByFilename(destinationContractPath);\n\n      sourceContractGroup.forEach((contractName, swagger) -> {\n\n        byte[] sourceSwagger = destinationContractGroup.get(contractName);\n\n        ContractComparator contractComparator = new ContractComparator(new String(sourceSwagger), new String(swagger));\n\n        if (!contractComparator.equals()) {\n          LOGGER.info(\"Contract is not matched, difference is as follows\");\n          LOGGER.info(destinationContractPath + \"/\" + contractName + \" vs \" + sourceContractPath + \"/\" + contractName);\n          contractComparator.splitPrintToScreen();\n        } else {\n          LOGGER.info(\"Succee, contract verification passed\");\n        }\n      });\n    } catch (IOException e) {\n      throw new RuntimeException(\"Failed to verify contract \", e);\n    }\n  }\n}\n"
  },
  {
    "path": "toolkit-maven-plugin/src/test/java/org/apache/servicecomb/toolkit/plugin/GenerateMojoTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.plugin;\n\nimport static org.hamcrest.CoreMatchers.containsString;\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertNotEquals;\nimport static org.junit.Assert.assertThat;\nimport static org.junit.Assert.fail;\nimport static org.mockito.BDDMockito.given;\nimport static org.mockito.Mockito.mock;\n\nimport java.io.File;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.Objects;\n\nimport org.apache.maven.plugin.MojoFailureException;\nimport org.apache.maven.plugin.testing.MojoRule;\nimport org.apache.maven.plugin.testing.resources.TestResources;\nimport org.apache.maven.project.MavenProject;\nimport org.apache.servicecomb.toolkit.common.FileUtils;\nimport org.junit.Rule;\nimport org.junit.Test;\n\n\npublic class GenerateMojoTest {\n\n  @Rule\n  public MojoRule rule = new MojoRule();\n\n  @Rule\n  public TestResources resources = new TestResources();\n\n  @Test\n  public void testGenerateMojo() throws Exception {\n\n    TestResourcesEx testResourcesEx = new TestResourcesEx(resources);\n\n    String testDirWithContract = testResourcesEx.getBasedirWithContract();\n    String testDirWithoutContract = testResourcesEx.getBasedirWithoutContract();\n    String testDirMultiModule = testResourcesEx.getBasedirMultiModule();\n\n    String outputDirectory = null;\n    String contractOutput = null;\n    String projectOutput = null;\n    String documentOutput = null;\n\n    final MavenProject project = mock(MavenProject.class);\n    given(project.getBasedir()).willReturn(new File(\"mockProject\"));\n\n    // code has no contract\n    testResourcesEx.createMojo(rule, \"generate\");\n    testResourcesEx.setVariableValueToObject(\"project\", project);\n    given(project.getRuntimeClasspathElements()).willReturn(testResourcesEx.getRuntimeUrlPath(testDirWithoutContract));\n    try {\n      outputDirectory = \"target/GenerateMojoTest\";\n\n      FileUtils.deleteDirectory(outputDirectory);\n      testResourcesEx.setVariableValueToObject(\"sourceType\", \"code\");\n      testResourcesEx.setVariableValueToObject(\"outputDirectory\", outputDirectory);\n\n      testResourcesEx.execute();\n\n      assertFalse(new File(testResourcesEx.getVariableValueFromObject(\"contractLocation\")).listFiles().length != 0);\n    } catch (MojoFailureException e) {\n      fail(\"Run 'testGenerateMojo' failed, unexpected to catch MojoFailureException: \" + e.getMessage());\n    }\n\n    // code has contract\n    testResourcesEx.createMojo(rule, \"generate\");\n    testResourcesEx.setVariableValueToObject(\"project\", project);\n    given(project.getRuntimeClasspathElements()).willReturn(testResourcesEx.getRuntimeUrlPath(testDirWithContract));\n    try {\n      outputDirectory = \"target/GenerateMojoTest\";\n      contractOutput = outputDirectory + File.separator + \"contract\";\n      projectOutput = outputDirectory + File.separator + \"project\";\n      documentOutput = outputDirectory + File.separator + \"document\";\n\n      testResourcesEx.setVariableValueToObject(\"sourceType\", \"code\");\n      testResourcesEx.setVariableValueToObject(\"outputDirectory\", outputDirectory);\n      testResourcesEx.setVariableValueToObject(\"contractFileType\", \"yaml\");\n      testResourcesEx.setVariableValueToObject(\"documentType\", \"html\");\n      testResourcesEx.setVariableValueToObject(\"service\", new ServiceConfig());\n      testResourcesEx.setVariableValueToObject(\"additionalProperties\", new HashMap<>());\n\n      testResourcesEx.execute();\n\n      assertNotEquals(0, Objects.requireNonNull(new File(contractOutput).listFiles()).length);\n      assertNotEquals(0, Objects.requireNonNull(new File(projectOutput).listFiles()).length);\n      assertNotEquals(0, Objects.requireNonNull(new File(documentOutput).listFiles()).length);\n    } catch (RuntimeException e) {\n      e.printStackTrace();\n      fail(\"Run 'testGenerateMojo' failed, unexpected to catch RuntimeException: \" + e.getMessage());\n    }\n\n    try {\n      testResourcesEx.setVariableValueToObject(\"sourceType\", \"contract\");\n      testResourcesEx.setVariableValueToObject(\"contractLocation\", null);\n\n      testResourcesEx.execute();\n\n      fail(\"Run 'testGenerateMojo' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertEquals(\"Invalid or not config contract location\", e.getMessage());\n    }\n\n    try {\n      testResourcesEx.setVariableValueToObject(\"sourceType\", \"contract\");\n      testResourcesEx.setVariableValueToObject(\"contractLocation\", \"\");\n\n      testResourcesEx.execute();\n\n      fail(\"Run 'testGenerateMojo' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertThat(e.getMessage(), containsString(\"is not exists\"));\n    }\n\n    try {\n      outputDirectory = \"target/GenerateMojoTest\";\n      projectOutput = outputDirectory + File.separator + \"project\";\n      documentOutput = outputDirectory + File.separator + \"document\";\n\n      testResourcesEx.setVariableValueToObject(\"sourceType\", \"contract\");\n      testResourcesEx.setVariableValueToObject(\"contractLocation\", testResourcesEx.getContractLocation());\n      testResourcesEx.setVariableValueToObject(\"outputDirectory\", outputDirectory);\n      testResourcesEx.setVariableValueToObject(\"service\", new ServiceConfig());\n\n      testResourcesEx.execute();\n\n      assertNotEquals(0, Objects.requireNonNull(new File(projectOutput).listFiles()).length);\n      assertNotEquals(0, Objects.requireNonNull(new File(documentOutput).listFiles()).length);\n    } catch (RuntimeException e) {\n      fail(\"Run 'testGenerateMojo' failed, unexpected to catch RuntimeException: \" + e.getMessage());\n    }\n\n    outputDirectory = \"target/GenerateMojoTest\";\n    projectOutput = outputDirectory + File.separator + \"project\";\n    ServiceConfig service = new ServiceConfig();\n\n    testResourcesEx.setVariableValueToObject(\"sourceType\", \"code\");\n    testResourcesEx.setVariableValueToObject(\"outputDirectory\", outputDirectory);\n    FileUtils.deleteDirectory(projectOutput);\n    FileUtils.createDirectory(projectOutput);\n    testResourcesEx.setVariableValueToObject(\"service\", null);\n    testResourcesEx.execute();\n    assertEquals(0, Objects.requireNonNull(new File(projectOutput).listFiles()).length);\n\n    testResourcesEx.setVariableValueToObject(\"sourceType\", \"code\");\n    testResourcesEx.setVariableValueToObject(\"outputDirectory\", outputDirectory);\n    testResourcesEx.setVariableValueToObject(\"service\", service);\n    testResourcesEx.execute();\n    assertNotEquals(0, Objects.requireNonNull(new File(projectOutput).listFiles()).length);\n\n    // test multi module\n    given(project.getRuntimeClasspathElements()).willReturn(testResourcesEx.getRuntimeUrlPath(testDirMultiModule));\n    MavenProject subModuleProject = mock(MavenProject.class);\n    given(subModuleProject.getRuntimeClasspathElements())\n        .willReturn(testResourcesEx.getRuntimeUrlPath(testDirMultiModule + File.separator + \"first-module\"));\n    given(subModuleProject.getBasedir()).willReturn(new File(\"mockSubModuleProject\"));\n    given(project.getPackaging()).willReturn(\"pom\");\n    given(project.getCollectedProjects()).willReturn(Collections.singletonList(subModuleProject));\n\n    try {\n      outputDirectory = \"target/GenerateMojoTest\";\n      FileUtils.deleteDirectory(outputDirectory);\n      testResourcesEx.setVariableValueToObject(\"sourceType\", \"code\");\n      testResourcesEx.setVariableValueToObject(\"outputDirectory\", outputDirectory);\n      testResourcesEx.setVariableValueToObject(\"contractFileType\", \"yaml\");\n      testResourcesEx.setVariableValueToObject(\"documentType\", \"html\");\n      testResourcesEx.setVariableValueToObject(\"service\", new ServiceConfig());\n\n      testResourcesEx.execute();\n\n      assertFalse(new File(testResourcesEx.getVariableValueFromObject(\"contractLocation\")).listFiles().length != 0);\n    } catch (RuntimeException e) {\n      fail(\"Run 'testGenerateMojo' failed, unexpected to catch RuntimeException: \" + e.getMessage());\n    }\n  }\n}"
  },
  {
    "path": "toolkit-maven-plugin/src/test/java/org/apache/servicecomb/toolkit/plugin/GenerateUtilTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.plugin;\n\nimport static org.apache.servicecomb.toolkit.plugin.GenerateUtil.generateCode;\nimport static org.apache.servicecomb.toolkit.plugin.GenerateUtil.generateContract;\nimport static org.apache.servicecomb.toolkit.plugin.GenerateUtil.generateDocument;\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertNotEquals;\nimport static org.junit.Assert.fail;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nimport java.io.File;\nimport java.util.Collections;\nimport java.util.Objects;\n\nimport org.apache.maven.artifact.DependencyResolutionRequiredException;\nimport org.apache.maven.plugin.testing.resources.TestResources;\nimport org.apache.maven.project.MavenProject;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\n\npublic class GenerateUtilTest {\n\n  @Rule\n  public TestResources resources = new TestResources();\n\n  private TestResourcesEx testResourcesEx;\n\n  @Before\n  public void setUp() throws Exception {\n    this.testResourcesEx = new TestResourcesEx(resources);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Test\n  public void testGenerateContract() throws DependencyResolutionRequiredException {\n\n    MavenProject project = mock(MavenProject.class);\n\n    String contractOutput = \"target/GenerateUtilTest/contract\";\n    when(project.getRuntimeClasspathElements()).thenThrow(DependencyResolutionRequiredException.class);\n    try {\n      generateContract(project, contractOutput, \"yaml\", \"default\");\n\n      fail(\"Run 'testGenerateContract' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertEquals(\"Failed to get runtime class elements\", e.getMessage());\n    }\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Test\n  public void testGenerateCode() throws Exception {\n\n    String contractLocation = this.testResourcesEx.getContractLocation();\n\n    String projectOutput = \"target/GenerateUtilTest/project\";\n    ServiceConfig service = new ServiceConfig();\n    generateCode(service, contractLocation, projectOutput, Collections.EMPTY_MAP, \"default\");\n    assertNotEquals(0, Objects.requireNonNull(new File(projectOutput).listFiles()).length);\n\n    try {\n      generateCode(service, contractLocation, projectOutput, Collections.EMPTY_MAP, \"invalidType\");\n\n      fail(\"Run 'testGenerateCode' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertEquals(\"Cannot found code generator's implementation\", e.getMessage());\n    }\n\n    // Test the scenario where the configuration property contractLocation is specified as a file\n    generateCode(service, contractLocation + File.separator + \"HelloEndPoint.yaml\", projectOutput,\n        Collections.EMPTY_MAP, \"default\");\n    assertNotEquals(0, Objects.requireNonNull(new File(projectOutput).listFiles()).length);\n  }\n\n  @Test\n  public void testGenerateDocument() throws Exception {\n\n    String contractLocation = this.testResourcesEx.getContractLocation();\n\n    String codeOutput = \"target/GenerateUtilTest/document\";\n    generateDocument(contractLocation, codeOutput, \"default\");\n    assertNotEquals(0, Objects.requireNonNull(new File(codeOutput).listFiles()).length);\n\n    try {\n      generateDocument(contractLocation, codeOutput, \"invalidType\");\n\n      fail(\"Run 'testGenerateDocument' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertEquals(\"Cannot found document generator's implementation\", e.getMessage());\n    }\n  }\n}"
  },
  {
    "path": "toolkit-maven-plugin/src/test/java/org/apache/servicecomb/toolkit/plugin/InvokeStaticMethodTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.plugin;\n\nimport static org.hamcrest.CoreMatchers.containsString;\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertThat;\nimport static org.junit.Assert.fail;\nimport static org.mockito.BDDMockito.given;\nimport static org.mockito.Matchers.any;\nimport static org.mockito.Matchers.anyObject;\nimport static org.mockito.Matchers.anyString;\nimport static org.mockito.Mockito.mock;\n\nimport java.io.File;\nimport java.io.IOException;\n\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.apache.maven.plugin.MojoFailureException;\nimport org.apache.maven.plugin.testing.MojoRule;\nimport org.apache.maven.plugin.testing.resources.TestResources;\nimport org.apache.maven.project.MavenProject;\nimport org.apache.servicecomb.toolkit.common.FileUtils;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.powermock.api.mockito.PowerMockito;\nimport org.powermock.core.classloader.annotations.PowerMockIgnore;\nimport org.powermock.core.classloader.annotations.PrepareForTest;\nimport org.powermock.modules.junit4.PowerMockRunner;\n\n@RunWith(PowerMockRunner.class)\n@PrepareForTest({FileUtils.class, GenerateUtil.class})\n@PowerMockIgnore({\"javax.management.*\"})\npublic class InvokeStaticMethodTest {\n\n  @Rule\n  public MojoRule rule = new MojoRule();\n\n  @Rule\n  public TestResources resources = new TestResources();\n\n  private TestResourcesEx testGenerateMojoResources;\n\n  private TestResourcesEx testVerifyMojoResources;\n\n  @Before\n  public void setUp() throws Exception {\n\n    testGenerateMojoResources = new TestResourcesEx(resources);\n    testVerifyMojoResources = new TestResourcesEx(resources);\n\n    testGenerateMojoResources.createMojo(rule, \"generate\");\n    testVerifyMojoResources.createMojo(rule, \"verify\");\n\n    MavenProject project = mock(MavenProject.class);\n    given(project.getBasedir()).willReturn(new File(\"mockProject\"));\n    testGenerateMojoResources.setVariableValueToObject(\"project\", project);\n    testVerifyMojoResources.setVariableValueToObject(\"project\", project);\n  }\n\n  @Test\n  public void testVerifyMojoInvokeGenerateUtilGenerateContract()\n      throws MojoFailureException, MojoExecutionException, IllegalAccessException {\n\n    PowerMockito.mockStatic(GenerateUtil.class);\n    PowerMockito.doThrow(new RuntimeException()).when(GenerateUtil.class);\n    // Powermockito limit: use argument matchers to specify method which would be mock\n    GenerateUtil.generateContract(anyObject(), anyString(), anyString(), anyString());\n\n    testVerifyMojoResources.setVariableValueToObject(\"sourceType\", \"code\");\n    try {\n      testVerifyMojoResources.execute();\n\n      fail(\"Run 'testVerifyMojoInvokeGenerateUtilGenerateContract' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertEquals(\"Failed to generate contract from code\", e.getMessage());\n      assertThat(e.getCause().toString(), containsString(\"RuntimeException\"));\n    }\n  }\n\n  @Test\n  public void testVerifyMojoInvokeFileUtilsCreateTempDirectory()\n      throws MojoFailureException, MojoExecutionException, IllegalAccessException, IOException {\n\n    PowerMockito.mockStatic(FileUtils.class);\n    PowerMockito.doThrow(new IOException()).when(FileUtils.class);\n    // Powermockito limit: use argument matchers to specify method which would be mock\n    FileUtils.createTempDirectory(anyString());\n\n    testVerifyMojoResources.setVariableValueToObject(\"sourceType\", \"code\");\n    try {\n      testVerifyMojoResources.execute();\n\n      fail(\"Run 'testVerifyMojoInvokeFileUtilsCreateTempDirectory' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertEquals(\"Failed to generate contract from code\", e.getMessage());\n      assertThat(e.getCause().toString(), containsString(\"IOException\"));\n    }\n  }\n\n  @Test\n  public void testGenerateMojoInvokeFileUtilsCreateDirectory()\n      throws IllegalAccessException, MojoFailureException, MojoExecutionException, IOException {\n\n    PowerMockito.mockStatic(FileUtils.class);\n    PowerMockito.doThrow(new IOException()).when(FileUtils.class);\n    // Powermockito limit: use argument matchers to specify method which would be mock\n    FileUtils.createDirectory(anyString());\n\n    testGenerateMojoResources.setVariableValueToObject(\"sourceType\", \"code\");\n    try {\n      testGenerateMojoResources.execute();\n\n      fail(\"Run 'testGenerateMojoInvokeFileUtilsCreateDirectory' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertEquals(\"Failed to generate contract\", e.getMessage());\n      assertThat(e.getCause().toString(), containsString(\"IOException\"));\n    }\n  }\n\n  @Test\n  public void testGenerateMojoInvokeGenerateUtilGenerateCode()\n      throws IllegalAccessException, MojoFailureException, MojoExecutionException, IOException {\n\n    PowerMockito.mockStatic(GenerateUtil.class);\n    PowerMockito.doThrow(new IOException()).when(GenerateUtil.class);\n    // Powermockito limit: use argument matchers to specify method which would be mock\n    GenerateUtil.generateCode(anyObject(), anyString(), anyString(), any(), anyString());\n\n    testGenerateMojoResources.setVariableValueToObject(\"sourceType\", \"contract\");\n    testGenerateMojoResources.setVariableValueToObject(\"outputDirectory\", \"target/InvokeStaticMethodTest\");\n    testGenerateMojoResources\n        .setVariableValueToObject(\"contractLocation\", testGenerateMojoResources.getContractLocation());\n    testGenerateMojoResources.setVariableValueToObject(\"service\", new ServiceConfig());\n    try {\n      testGenerateMojoResources.execute();\n\n      fail(\"Run 'testGenerateMojoInvokeGenerateUtilGenerateCode' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertEquals(\"Failed to generate code\", e.getMessage());\n      assertThat(e.getCause().toString(), containsString(\"IOException\"));\n    }\n\n    PowerMockito.doThrow(new RuntimeException()).when(GenerateUtil.class);\n    GenerateUtil.generateCode(anyObject(), anyString(), anyString(), any(), anyString());\n    try {\n      testGenerateMojoResources.execute();\n\n      fail(\"Run 'testGenerateMojoInvokeGenerateUtilGenerateCode' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertEquals(\"Failed to generate code\", e.getMessage());\n      assertThat(e.getCause().toString(), containsString(\"RuntimeException\"));\n    }\n  }\n\n  @Test\n  public void testGenerateMojoInvokeGenerateUtilGenerateDocument()\n      throws IllegalAccessException, MojoFailureException, MojoExecutionException, IOException {\n\n    PowerMockito.mockStatic(GenerateUtil.class);\n    PowerMockito.doThrow(new IOException()).when(GenerateUtil.class);\n    // Powermockito limit: use argument matchers to specify method which would be mock\n    GenerateUtil.generateDocument(anyString(), anyString(), anyString());\n\n    testGenerateMojoResources.setVariableValueToObject(\"sourceType\", \"contract\");\n    testGenerateMojoResources.setVariableValueToObject(\"outputDirectory\", \"target/InvokeStaticMethodTest\");\n    testGenerateMojoResources\n        .setVariableValueToObject(\"contractLocation\", testGenerateMojoResources.getContractLocation());\n    testGenerateMojoResources.setVariableValueToObject(\"service\", new ServiceConfig());\n    try {\n      testGenerateMojoResources.execute();\n\n      fail(\n          \"Run 'testGenerateMojoInvokeGenerateUtilGenerateDocument' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertEquals(\"Failed to generate document\", e.getMessage());\n      assertThat(e.getCause().toString(), containsString(\"IOException\"));\n    }\n\n    PowerMockito.doThrow(new RuntimeException()).when(GenerateUtil.class);\n    GenerateUtil.generateDocument(anyString(), anyString(), anyString());\n    try {\n      testGenerateMojoResources.execute();\n\n      fail(\n          \"Run 'testGenerateMojoInvokeGenerateUtilGenerateDocument' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertEquals(\"Failed to generate document\", e.getMessage());\n      assertThat(e.getCause().toString(), containsString(\"RuntimeException\"));\n    }\n  }\n}\n"
  },
  {
    "path": "toolkit-maven-plugin/src/test/java/org/apache/servicecomb/toolkit/plugin/MavenPluginUtilTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.plugin;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertTrue;\nimport static org.mockito.BDDMockito.given;\nimport static org.mockito.Mockito.mock;\n\nimport org.apache.maven.project.MavenProject;\nimport org.junit.Test;\n\npublic class MavenPluginUtilTest {\n\n  @Test\n  public void isParentMavenProject() {\n\n    MavenProject mavenProject = mock(MavenProject.class);\n    given(mavenProject.getPackaging()).willReturn(\"pom\");\n    assertEquals(mavenProject.getPackaging(), \"pom\");\n    MavenPluginUtil mavenPluginUtil = new MavenPluginUtil();\n    assertTrue(mavenPluginUtil.isParentProject(mavenProject));\n  }\n\n  @Test\n  public void notParentMavenProject() {\n\n    MavenProject mavenProject = mock(MavenProject.class);\n    given(mavenProject.getPackaging()).willReturn(\"jar\");\n    assertEquals(mavenProject.getPackaging(), \"jar\");\n    MavenPluginUtil mavenPluginUtil = new MavenPluginUtil();\n    assertFalse(mavenPluginUtil.isParentProject(mavenProject));\n  }\n}\n"
  },
  {
    "path": "toolkit-maven-plugin/src/test/java/org/apache/servicecomb/toolkit/plugin/TestResourcesEx.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.plugin;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.concurrent.TimeoutException;\n\nimport org.apache.maven.plugin.AbstractMojo;\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.apache.maven.plugin.MojoFailureException;\nimport org.apache.maven.plugin.testing.MojoRule;\nimport org.apache.maven.plugin.testing.resources.TestResources;\nimport org.apache.servicecomb.toolkit.common.ClassMaker;\n\nclass TestResourcesEx {\n\n  private String basedirWithContract;\n\n  private String basedirWithoutContract;\n\n  private String contractLocation;\n\n  private String contractDestination;\n\n  private String basedirMultiModule;\n\n  private AbstractMojo testMojo;\n\n  private MojoRule rule;\n\n  TestResourcesEx(TestResources resources) throws Exception {\n\n    this.basedirWithContract = resources.getBasedir(\"demo-with-contract\") + File.separator;\n    this.basedirWithoutContract = resources.getBasedir(\"demo-without-contract\") + File.separator;\n    this.contractLocation = resources.getBasedir(\"contract-source\") + File.separator;\n    this.contractDestination = resources.getBasedir(\"contract-destination\") + File.separator;\n    this.basedirMultiModule = resources.getBasedir(\"demo-multi-module\") + File.separator;\n  }\n\n  void createMojo(MojoRule rule, String pluginGoal) {\n    this.rule = rule;\n    this.testMojo = mockMojo(pluginGoal);\n  }\n\n  void setVariableValueToObject(String variable, Object value) throws IllegalAccessException {\n    this.rule.setVariableValueToObject(this.testMojo, variable, value);\n  }\n\n  String getVariableValueFromObject(@SuppressWarnings(\"SameParameterValue\") String variable)\n      throws IllegalAccessException {\n    return (String) this.rule.getVariableValueFromObject(this.testMojo, variable);\n  }\n\n  String getBasedirWithContract() {\n    return basedirWithContract;\n  }\n\n  String getBasedirWithoutContract() {\n    return basedirWithoutContract;\n  }\n\n  String getBasedirMultiModule() {\n    return basedirMultiModule;\n  }\n\n  String getContractLocation() {\n    return contractLocation;\n  }\n\n  String getContractDestination() {\n    return contractDestination;\n  }\n\n  void execute() throws MojoFailureException, MojoExecutionException {\n    this.testMojo.execute();\n  }\n\n  List<String> getRuntimeUrlPath(String basedir) throws InterruptedException, TimeoutException, IOException {\n\n    ClassMaker.compile(basedir);\n\n    List<String> runtimeUrlPath = new ArrayList<>();\n\n    runtimeUrlPath.add(basedir + \"target\" + File.separator + \"classes\");\n\n    return runtimeUrlPath;\n  }\n\n  private AbstractMojo mockMojo(String pluginGoal) {\n    switch (pluginGoal) {\n      case \"generate\":\n        return new GenerateMojo();\n      case \"verify\":\n        return new VerifyMojo();\n      default:\n        throw new RuntimeException(\"undefined plugin goal\");\n    }\n  }\n}\n"
  },
  {
    "path": "toolkit-maven-plugin/src/test/java/org/apache/servicecomb/toolkit/plugin/VerifyMojoTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.servicecomb.toolkit.plugin;\n\nimport static org.hamcrest.CoreMatchers.containsString;\nimport static org.junit.Assert.assertThat;\nimport static org.junit.Assert.fail;\nimport static org.mockito.BDDMockito.given;\nimport static org.mockito.Mockito.mock;\n\nimport org.apache.maven.plugin.testing.MojoRule;\nimport org.apache.maven.plugin.testing.resources.TestResources;\nimport org.apache.maven.project.MavenProject;\nimport org.junit.Rule;\nimport org.junit.Test;\n\npublic class VerifyMojoTest {\n\n  @Rule\n  public MojoRule rule = new MojoRule();\n\n  @Rule\n  public TestResources resources = new TestResources();\n\n  @Test\n  public void testVerifyMojo() throws Exception {\n\n    TestResourcesEx testResourcesEx = new TestResourcesEx(resources);\n\n    String testDirWithContract = testResourcesEx.getBasedirWithContract();\n\n    testResourcesEx.createMojo(rule, \"verify\");\n\n    MavenProject project = mock(MavenProject.class);\n    testResourcesEx.setVariableValueToObject(\"project\", project);\n\n    try {\n      given(project.getRuntimeClasspathElements()).willReturn(testResourcesEx.getRuntimeUrlPath(testDirWithContract));\n      testResourcesEx.setVariableValueToObject(\"sourceType\", \"code\");\n      testResourcesEx.setVariableValueToObject(\"destinationContractPath\", testResourcesEx.getContractDestination());\n      testResourcesEx.execute();\n    } catch (RuntimeException e) {\n      fail(\"Run 'testVerifyMojo' failed, unexpected to catch RuntimeException: \" + e.getMessage());\n    }\n\n    try {\n      testResourcesEx.setVariableValueToObject(\"sourceType\", \"contract\");\n      testResourcesEx.setVariableValueToObject(\"sourceContractPath\", null);\n\n      testResourcesEx.execute();\n\n      fail(\"Run 'testVerifyMojo' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertThat(e.getMessage(), containsString(\"Failed to verify contract\"));\n    }\n\n    try {\n      testResourcesEx.setVariableValueToObject(\"sourceType\", \"contract\");\n      testResourcesEx.setVariableValueToObject(\"sourceContractPath\", testResourcesEx.getContractLocation());\n      testResourcesEx.setVariableValueToObject(\"destinationContractPath\", null);\n\n      testResourcesEx.execute();\n\n      fail(\"Run 'testVerifyMojo' failed, expected to occur RuntimeException but not\");\n    } catch (RuntimeException e) {\n      assertThat(e.getMessage(), containsString(\"Failed to verify contract\"));\n    }\n\n    try {\n      testResourcesEx.setVariableValueToObject(\"sourceType\", \"contract\");\n      testResourcesEx.setVariableValueToObject(\"sourceContractPath\", testResourcesEx.getContractLocation());\n      testResourcesEx.setVariableValueToObject(\"destinationContractPath\", testResourcesEx.getContractDestination());\n      testResourcesEx.execute();\n    } catch (RuntimeException e) {\n      fail(\"Run 'testVerifyMojo' failed, unexpected to catch RuntimeException: \" + e.getMessage());\n    }\n  }\n}"
  },
  {
    "path": "toolkit-maven-plugin/src/test/projects/contract-destination/HelloEndPoint.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n---\nswagger: \"2.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"swagger definition for demo.HelloEndPoint\"\n  x-java-interface: \"gen.swagger.HelloEndPointIntf\"\nbasePath: \"/hello\"\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\npaths:\n  /sayHello:\n    get:\n      operationId: \"sayHello\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: require\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n  /sayHi:\n    get:\n      operationId: \"sayHi\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n"
  },
  {
    "path": "toolkit-maven-plugin/src/test/projects/contract-source/HelloEndPoint.yaml",
    "content": "## ---------------------------------------------------------------------------\n## Licensed to the Apache Software Foundation (ASF) under one or more\n## contributor license agreements.  See the NOTICE file distributed with\n## this work for additional information regarding copyright ownership.\n## The ASF licenses this file to You under the Apache License, Version 2.0\n## (the \"License\"); you may not use this file except in compliance with\n## the License.  You may obtain a copy of the License at\n##\n##      http://www.apache.org/licenses/LICENSE-2.0\n##\n## Unless required by applicable law or agreed to in writing, software\n## distributed under the License is distributed on an \"AS IS\" BASIS,\n## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n## See the License for the specific language governing permissions and\n## limitations under the License.\n## ---------------------------------------------------------------------------\n\n---\nswagger: \"2.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"swagger definition for demo.HelloEndPoint\"\n  x-java-interface: \"gen.swagger.HelloEndPointIntf\"\nbasePath: \"/hello\"\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\npaths:\n  /sayHello:\n    get:\n      operationId: \"sayHello\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n  /sayHi:\n    get:\n      operationId: \"sayHi\"\n      parameters:\n      - name: \"name\"\n        in: \"query\"\n        required: false\n        type: \"string\"\n      responses:\n        200:\n          description: \"response of 200\"\n          schema:\n            type: \"string\"\n"
  },
  {
    "path": "toolkit-maven-plugin/src/test/projects/demo-multi-module/first-module/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n  <parent>\n    <groupId>org.apache.servicecomb.toolkit</groupId>\n    <artifactId>demo-multi-module</artifactId>\n    <version>0.3.0-SNAPSHOT</version>\n  </parent>\n  <artifactId>first-module</artifactId>\n</project>"
  },
  {
    "path": "toolkit-maven-plugin/src/test/projects/demo-multi-module/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>org.apache.servicecomb.toolkit</groupId>\n  <artifactId>demo-multi-module</artifactId>\n  <version>0.3.0-SNAPSHOT</version>\n  <name>demo-multi-module-test</name>\n  <packaging>pom</packaging>\n\n  <modules>\n    <module>first-module</module>\n  </modules>\n</project>"
  },
  {
    "path": "toolkit-maven-plugin/src/test/projects/demo-with-contract/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>org.apache.servicecomb.toolkit</groupId>\n  <artifactId>demo-with-contract</artifactId>\n  <version>0.3.0-SNAPSHOT</version>\n  <name>demo-with-contract-test</name>\n  <packaging>jar</packaging>\n\n  <parent>\n    <groupId>org.springframework.boot</groupId>\n    <artifactId>spring-boot-starter-parent</artifactId>\n    <version>1.5.12.RELEASE</version>\n    <relativePath/> <!-- lookup parent from repository -->\n  </parent>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter</artifactId>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-web</artifactId>\n    </dependency>\n  </dependencies>\n</project>"
  },
  {
    "path": "toolkit-maven-plugin/src/test/projects/demo-with-contract/src/main/java/demo/Application.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage demo;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\npublic class Application {\n  public Application() {\n  }\n\n  public static void main(String[] args) {\n    SpringApplication.run(Application.class, args);\n  }\n}\n"
  },
  {
    "path": "toolkit-maven-plugin/src/test/projects/demo-with-contract/src/main/java/demo/HelloEndPoint.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage demo;\n\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n@RestController\n@RequestMapping({\"/hello\"})\npublic class HelloEndPoint {\n  public HelloEndPoint() {\n  }\n\n  @GetMapping({\"/sayHello\"})\n  public String sayHello(String name) {\n    return \"Hello, \" + name;\n  }\n\n  @GetMapping({\"/sayHi\"})\n  public String sayHi(String name) {\n    return \"Hi, \" + name;\n  }\n}\n"
  },
  {
    "path": "toolkit-maven-plugin/src/test/projects/demo-without-contract/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>org.apache.servicecomb.toolkit</groupId>\n  <artifactId>demo-without-contract</artifactId>\n  <version>0.3.0-SNAPSHOT</version>\n  <name>demo-without-contract-test</name>\n  <packaging>jar</packaging>\n\n  <parent>\n    <groupId>org.springframework.boot</groupId>\n    <artifactId>spring-boot-starter-parent</artifactId>\n    <version>1.5.12.RELEASE</version>\n    <relativePath/> <!-- lookup parent from repository -->\n  </parent>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.springframework.boot</groupId>\n      <artifactId>spring-boot-starter</artifactId>\n    </dependency>\n  </dependencies>\n</project>"
  },
  {
    "path": "toolkit-maven-plugin/src/test/projects/demo-without-contract/src/main/java/demo/Application.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage demo;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\npublic class Application {\n  public Application() {\n  }\n\n  public static void main(String[] args) {\n    SpringApplication.run(Application.class, args);\n  }\n}\n"
  },
  {
    "path": "toolkit-maven-plugin/src/test/resources/log4j2-test.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Licensed to the Apache Software Foundation (ASF) under one or more\n  ~ contributor license agreements.  See the NOTICE file distributed with\n  ~ this work for additional information regarding copyright ownership.\n  ~ The ASF licenses this file to You under the Apache License, Version 2.0\n  ~ (the \"License\"); you may not use this file except in compliance with\n  ~ the License.  You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!--this is sample configuration, please modify as your wish-->\n\n<configuration>\n  <loggers>\n    <logger name=\"org.openapitools\" additivity=\"false\" level=\"OFF\">\n    </logger>\n  </loggers>\n</configuration>"
  }
]