-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new api module to support custom rule and ported 3 existing rul…
…es into new design. I
- Loading branch information
Showing
42 changed files
with
420 additions
and
246 deletions.
There are no files selected for viewing
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,59 @@ | ||
plugins { | ||
id "com.diffplug.spotless" version "6.9.1" | ||
} | ||
|
||
dependencies { | ||
implementation 'org.eclipse.microprofile.openapi:microprofile-openapi-api:3.0' | ||
testImplementation 'org.slf4j:slf4j-jdk14:2.0.0' | ||
testImplementation 'org.openapitools.empoa:empoa-simple-models-impl:2.0.0' | ||
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.10.1' | ||
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' | ||
implementation group: 'org.reflections', name: 'reflections', version: '0.10.2' | ||
} | ||
|
||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
spotless { | ||
java { | ||
removeUnusedImports() | ||
trimTrailingWhitespace() | ||
palantirJavaFormat() | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifactId = 'openapi-style-validator-api' | ||
pom { | ||
name = 'OpenAPI Style Validator - api' | ||
description = 'module to expose API for writing rules to validate the style and standards of an OpenAPI specification' | ||
packaging = 'jar' | ||
url = 'https://openapitools.github.io/openapi-style-validator/' | ||
inceptionYear = "2019" | ||
licenses { | ||
license { | ||
name = 'Apache 2.0 License' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'JFCote' | ||
name = 'Jean-Francois Cote' | ||
email = 'jcote@stingray.com' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:https://github.com/openapitools/openapi-style-validator.git' | ||
developerConnection = 'scm:git:https://github.com/openapitools/openapi-style-validator.git' | ||
url = 'https://github.com/openapitools/openapi-style-validator/' | ||
} | ||
} | ||
from components.java | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
api/src/main/java/org/openapitools/openapistylevalidator/api/Rule.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,14 @@ | ||
package org.openapitools.openapistylevalidator.api; | ||
|
||
import java.util.Optional; | ||
import org.eclipse.microprofile.openapi.models.OpenAPI; | ||
import org.openapitools.openapistylevalidator.error.StyleError; | ||
|
||
public interface Rule { | ||
|
||
String ruleName(); | ||
|
||
String description(); | ||
|
||
Optional<StyleError> execute(OpenAPI api); | ||
} |
2 changes: 1 addition & 1 deletion
2
...lidator/styleerror/GenericStyleError.java → ...ylevalidator/error/GenericStyleError.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
2 changes: 1 addition & 1 deletion
2
...tor/styleerror/ModelNamingStyleError.java → ...alidator/error/ModelNamingStyleError.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
2 changes: 1 addition & 1 deletion
2
...validator/styleerror/ModelStyleError.java → ...stylevalidator/error/ModelStyleError.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
2 changes: 1 addition & 1 deletion
2
...styleerror/OperationNamingStyleError.java → ...ator/error/OperationNamingStyleError.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
2 changes: 1 addition & 1 deletion
2
...dator/styleerror/OperationStyleError.java → ...evalidator/error/OperationStyleError.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
9 changes: 9 additions & 0 deletions
9
api/src/main/java/org/openapitools/openapistylevalidator/error/StyleCheckSection.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,9 @@ | ||
package org.openapitools.openapistylevalidator.error; | ||
|
||
public enum StyleCheckSection { | ||
APIInfo, | ||
Operations, | ||
Models, | ||
Naming, | ||
OpenAPI, | ||
} |
10 changes: 1 addition & 9 deletions
10
...stylevalidator/styleerror/StyleError.java → ...enapistylevalidator/error/StyleError.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
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.