Skip to content

Commit 84ea10a

Browse files
author
Matheus Cruz
committed
Apply formatter
1 parent e05f303 commit 84ea10a

27 files changed

+136
-82
lines changed

moqu/core/src/main/java/io/quarkiverse/openapi/generator/model/Header.java

Lines changed: 0 additions & 6 deletions
This file was deleted.

moqu/core/src/main/java/io/quarkiverse/openapi/generator/model/Operation.java

Lines changed: 0 additions & 4 deletions
This file was deleted.

moqu/core/src/main/java/io/quarkiverse/openapi/generator/model/Parameter.java

Lines changed: 0 additions & 6 deletions
This file was deleted.

moqu/core/src/main/java/io/quarkiverse/openapi/generator/model/Request.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

moqu/core/src/main/java/io/quarkiverse/openapi/generator/model/RequestResponsePair.java

Lines changed: 0 additions & 5 deletions
This file was deleted.

moqu/core/src/main/java/io/quarkiverse/openapi/generator/model/Response.java

Lines changed: 0 additions & 9 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
package io.quarkiverse.openapi.generator;
1+
package io.quarkiverse.openapi.moqu;
22

33
import java.util.ArrayList;
4+
import java.util.Collections;
45
import java.util.List;
56
import java.util.Objects;
67

7-
import io.quarkiverse.openapi.generator.model.RequestResponsePair;
8+
import io.quarkiverse.openapi.moqu.model.RequestResponsePair;
9+
import io.quarkiverse.openapi.moqu.model.Request;
10+
import io.quarkiverse.openapi.moqu.model.Response;
811

12+
/**
13+
* Moqu represents all {@link Request} and {@link Response}
14+
* pair list.
15+
*/
916
public class Moqu {
1017

1118
private List<RequestResponsePair> requestResponsePairs = new ArrayList<>();
@@ -15,6 +22,6 @@ public Moqu(List<RequestResponsePair> requestResponsePairs) {
1522
}
1623

1724
public List<RequestResponsePair> getRequestResponsePairs() {
18-
return requestResponsePairs;
25+
return Collections.unmodifiableList(requestResponsePairs);
1926
}
2027
}

moqu/core/src/main/java/io/quarkiverse/openapi/generator/MoquImporter.java renamed to moqu/core/src/main/java/io/quarkiverse/openapi/moqu/MoquImporter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.quarkiverse.openapi.generator;
1+
package io.quarkiverse.openapi.moqu;
22

33
/**
44
* {@link MoquImporter} aims to convert an specification {@link Moqu} model.

moqu/core/src/main/java/io/quarkiverse/openapi/generator/MoquMapper.java renamed to moqu/core/src/main/java/io/quarkiverse/openapi/moqu/MoquMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.quarkiverse.openapi.generator;
1+
package io.quarkiverse.openapi.moqu;
22

33
import java.util.List;
44

moqu/core/src/main/java/io/quarkiverse/openapi/generator/OpenAPIMoquImporter.java renamed to moqu/core/src/main/java/io/quarkiverse/openapi/moqu/OpenAPIMoquImporter.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.quarkiverse.openapi.generator;
1+
package io.quarkiverse.openapi.moqu;
22

33
import static io.swagger.v3.parser.util.SchemaTypeUtil.INTEGER_TYPE;
44
import static io.swagger.v3.parser.util.SchemaTypeUtil.OBJECT_TYPE;
@@ -21,10 +21,10 @@
2121
import com.google.common.collect.ArrayListMultimap;
2222
import com.google.common.collect.Multimap;
2323

24-
import io.quarkiverse.openapi.generator.model.Header;
25-
import io.quarkiverse.openapi.generator.model.Request;
26-
import io.quarkiverse.openapi.generator.model.RequestResponsePair;
27-
import io.quarkiverse.openapi.generator.model.Response;
24+
import io.quarkiverse.openapi.moqu.model.Header;
25+
import io.quarkiverse.openapi.moqu.model.Request;
26+
import io.quarkiverse.openapi.moqu.model.RequestResponsePair;
27+
import io.quarkiverse.openapi.moqu.model.Response;
2828
import io.swagger.v3.oas.models.OpenAPI;
2929
import io.swagger.v3.oas.models.Operation;
3030
import io.swagger.v3.oas.models.PathItem;
@@ -170,19 +170,19 @@ private Map<Request, Response> getContentRequestResponsePairs(Map.Entry<String,
170170
List.of());
171171

172172
Multimap<String, String> onPath = parametersOnPath.get(exampleName);
173-
List<io.quarkiverse.openapi.generator.model.Parameter> reqParams = new ArrayList<>();
173+
List<io.quarkiverse.openapi.moqu.model.Parameter> reqParams = new ArrayList<>();
174174

175175
if (onPath != null) {
176176
for (Map.Entry<String, String> paramEntry : onPath.entries()) {
177-
io.quarkiverse.openapi.generator.model.Parameter parameter = new io.quarkiverse.openapi.generator.model.Parameter(
177+
io.quarkiverse.openapi.moqu.model.Parameter parameter = new io.quarkiverse.openapi.moqu.model.Parameter(
178178
paramEntry.getKey(),
179179
paramEntry.getValue(),
180180
ParameterType.PATH);
181181
reqParams.add(parameter);
182182
}
183183
}
184184

185-
List<io.quarkiverse.openapi.generator.model.Parameter> parameters = reqParams.stream()
185+
List<io.quarkiverse.openapi.moqu.model.Parameter> parameters = reqParams.stream()
186186
.filter(reqParam -> reqParam.where().equals(ParameterType.PATH)).toList();
187187
String finalUrl = resolveUrlParameters(url, parameters);
188188
Request request = new Request(
@@ -206,8 +206,8 @@ private String resolveContent(Map<String, Schema> localSchemas, Example example)
206206
}
207207
}
208208

209-
private String resolveUrlParameters(String url, List<io.quarkiverse.openapi.generator.model.Parameter> parameters) {
210-
for (io.quarkiverse.openapi.generator.model.Parameter parameter : parameters) {
209+
private String resolveUrlParameters(String url, List<io.quarkiverse.openapi.moqu.model.Parameter> parameters) {
210+
for (io.quarkiverse.openapi.moqu.model.Parameter parameter : parameters) {
211211
String placeholder = "{%s}".formatted(parameter.key());
212212
url = url.replace(placeholder, parameter.value());
213213
}

0 commit comments

Comments
 (0)