Skip to content

Use Prisms 1.4 #165

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions http-generator-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-prisms</artifactId>
<version>1.3</version>
<version>1.4</version>
<optional>true</optional>
<scope>provided</scope>
</dependency>
Expand Down Expand Up @@ -62,15 +62,6 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<version>2.0.1</version>
<optional>true</optional>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
Expand All @@ -92,7 +83,7 @@
<path>
<groupId>io.avaje</groupId>
<artifactId>avaje-prisms</artifactId>
<version>1.3</version>
<version>1.4</version>
</path>
</annotationProcessorPaths>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private List<Element> initInterfaces() {
final Element ifaceElement = ctx.asElement(anInterface);
final var controller = ControllerPrism.getInstanceOn(ifaceElement);
if (controller != null && !controller.value().isBlank()
|| PathPrism.getInstanceOn(ifaceElement) != null) {
|| PathPrism.isPresent(ifaceElement)) {
interfaces.add(ifaceElement);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ private boolean useValidation() {
}
final var elementType = ctx.typeElement(rawType);
return elementType != null
&& (ValidPrism.getInstanceOn(elementType) != null
|| JavaxValidPrism.getInstanceOn(elementType) != null);
&& (ValidPrism.isPresent(elementType) || JavaxValidPrism.isPresent(elementType));
}

private void readAnnotations(Element element, ParamType defaultType) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ private <T> void populateObjectSchema(TypeMirror objectType, Schema<T> objectSch
}

private void setFormatFromValidation(Element element, Schema<?> propSchema) {
if (EmailPrism.getOptionalOn(element).isPresent()
|| JavaxEmailPrism.getOptionalOn(element).isPresent()) {
if (EmailPrism.isPresent(element) || JavaxEmailPrism.isPresent(element)) {
propSchema.setFormat("email");
}
}
Expand Down Expand Up @@ -311,7 +310,7 @@ private boolean ignoreField(VariableElement field) {
}

private boolean isHiddenField(VariableElement field) {
if (HiddenPrism.getOptionalOn(field).isPresent()) {
if (HiddenPrism.isPresent(field)) {
return true;
}
for (AnnotationMirror annotationMirror : field.getAnnotationMirrors()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
@GeneratePrism(value = io.avaje.http.api.Post.class, publicAccess = true)
@GeneratePrism(value = io.avaje.http.api.Produces.class, publicAccess = true)
@GeneratePrism(value = io.avaje.http.api.Put.class, publicAccess = true)
@GeneratePrism(value = jakarta.inject.Inject.class)
@GeneratePrism(value = io.swagger.v3.oas.annotations.OpenAPIDefinition.class, publicAccess = true)
@GeneratePrism(value = io.swagger.v3.oas.annotations.tags.Tag.class, publicAccess = true)
@GeneratePrism(value = io.swagger.v3.oas.annotations.tags.Tags.class, publicAccess = true)
Expand Down
1 change: 0 additions & 1 deletion http-generator-core/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
requires static transitive io.swagger.v3.oas.models;
requires static transitive io.swagger.v3.oas.annotations;
requires static transitive java.validation;
requires static transitive jakarta.inject;
requires static transitive jakarta.validation;
}