generated from konveyor/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[234] Create rules detecting use of MicroProfile OpenAPI to facilitat…
…e EAP XP5->6 migration.
- Loading branch information
Showing
8 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
default/generated/eapxp6/180-eapxp_microprofile_openapi_4.0.mta.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
- category: mandatory | ||
customVariables: [] | ||
description: MicroProfile OpenAPI 4.0 | ||
effort: 1 | ||
labels: | ||
- konveyor.io/source=eapxp | ||
- konveyor.io/target=eapxp6 | ||
- konveyor.io/target=eapxp | ||
- JBossEAP | ||
- EAPXP | ||
links: [] | ||
message: When migrating an application making use of MicroProfile OpenAPI to JBoss EAP XP 6.0 (or later), please note that MicroProfile OpenAPI 4.0 introduces potentially incompatible changes as documented. See https://download.eclipse.org/microprofile/microprofile-open-api-4.0/microprofile-openapi-spec-4.0.html#incompatible_changes_40 | ||
ruleID: eapxp_microprofile_openapi_4.0-00001 | ||
when: | ||
or: | ||
- java.dependency: | ||
name: org.eclipse.microprofile.openapi.microprofile-openapi-api | ||
lowerbound: 0.0.0 | ||
- builtin.file: | ||
pattern: openapi\.(yaml|yml|json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name: eapxp6 | ||
description: This ruleset provides analysis of Maven built applications when migrating from EAP XP 5 -> 6. |
42 changes: 42 additions & 0 deletions
42
default/generated/eapxp6/test/data/eapxp_microprofile_openapi_4.0/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.example</groupId> | ||
<artifactId>microprofile-openapi-example</artifactId> | ||
<version>1.0.0</version> | ||
<packaging>war</packaging> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>jakarta.platform</groupId> | ||
<artifactId>jakarta.jakartaee-bom</artifactId> | ||
<version>10.0.0</version> | ||
<scope>import</scope> | ||
<type>pom</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.microprofile</groupId> | ||
<artifactId>microprofile</artifactId> | ||
<version>7.0</version> | ||
<scope>import</scope> | ||
<type>pom</type> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>jakarta.ws.rs</groupId> | ||
<artifactId>jakarta.ws.rs-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.microprofile.openapi</groupId> | ||
<artifactId>microprofile-openapi-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
25 changes: 25 additions & 0 deletions
25
...xp6/test/data/eapxp_microprofile_openapi_4.0/src/main/java/org/konveyor/EchoResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.konveyor; | ||
|
||
import jakarta.ws.rs.ApplicationPath; | ||
import jakarta.ws.rs.core.Application; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
|
||
/** | ||
* @author Paul Ferraro | ||
*/ | ||
@Path("/echo") | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public class EchoResource { | ||
|
||
@GET | ||
@Path("{value}") | ||
public String echo(@PathParam("value") String value) { | ||
return value; | ||
} | ||
} | ||
|
13 changes: 13 additions & 0 deletions
13
.../test/data/eapxp_microprofile_openapi_4.0/src/main/java/org/konveyor/TestApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.konveyor; | ||
|
||
import jakarta.ws.rs.ApplicationPath; | ||
import jakarta.ws.rs.core.Application; | ||
|
||
/** | ||
* @author Paul Ferraro | ||
*/ | ||
@ApplicationPath("/test") | ||
public class TestApplication extends Application { | ||
|
||
} | ||
|
38 changes: 38 additions & 0 deletions
38
...ated/eapxp6/test/data/eapxp_microprofile_openapi_4.0/src/main/webapp/WEB-INF/openapi.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"openapi" : "3.1.0", | ||
"paths" : { | ||
"/test/echo/{value}" : { | ||
"get" : { | ||
"parameters" : [ { | ||
"name" : "value", | ||
"in" : "path", | ||
"required" : true, | ||
"schema" : { | ||
"type" : "string" | ||
} | ||
} ], | ||
"responses" : { | ||
"200" : { | ||
"description" : "OK", | ||
"content" : { | ||
"text/plain" : { | ||
"schema" : { | ||
"type" : "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"info" : { | ||
"title" : "Test application", | ||
"description" : "This is my test application description", | ||
"version" : "1.0" | ||
}, | ||
"servers" : [ { | ||
"url" : "/test" | ||
} ] | ||
} | ||
|
11 changes: 11 additions & 0 deletions
11
...generated/eapxp6/test/data/eapxp_microprofile_openapi_4.0/src/main/webapp/WEB-INF/web.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright The WildFly Authors | ||
~ SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd" | ||
version="6.0"> | ||
</web-app> | ||
|
16 changes: 16 additions & 0 deletions
16
default/generated/eapxp6/test/eapxp_microprofile_openapi_4.0.test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
rulesPath: ../eapxp_microprofile_openapi_4.0.mta.yaml | ||
providers: | ||
- name: java | ||
dataPath: ./data/eapxp_microprofile_openapi_4.0 | ||
- name: builtin | ||
dataPath: ./data/eapxp_microprofile_openapi_4.0 | ||
tests: | ||
- ruleID: eapxp_microprofile_openapi_4.0-00001 | ||
testCases: | ||
- name: MP-OpenAPI-Dependency-1 | ||
hasIncidents: | ||
exactly: 1 | ||
- name: MP-OpenAPI-Document-1 | ||
hasIncidents: | ||
exactly: 1 | ||
|