From 4743f31ea970c7fea79dc3b791bee948dd69ddf2 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 16 Apr 2026 10:05:38 +0200 Subject: [PATCH] Change package of examples to avoid split package in IDE --- .../src/main/asciidoc/index.adoc | 14 +- .../{ => api/service}/ApiCodegenExamples.java | 2 +- .../{ => api/service}/OpenAPIExamples.java | 2 +- .../{ => api/service}/TransactionService.java | 4 +- .../service}/TransactionServiceImpl.java | 4 +- .../{ => api/service}/package-info.java | 2 +- vertx-web-client/src/main/asciidoc/index.adoc | 126 +++++++++--------- .../CachingWebClientExamples.java | 2 +- .../{ => client}/WebClientExamples.java | 2 +- .../{ => client}/WebClientOauth2Examples.java | 2 +- .../WebClientSessionExamples.java | 6 +- .../examples/{ => client}/package-info.java | 2 +- .../src/main/asciidoc/index.adoc | 40 +++--- .../{ => graphql}/GraphQLExamples.java | 2 +- .../examples/{ => graphql}/package-info.java | 2 +- .../src/main/asciidoc/index.adoc | 12 +- .../{ => openapi/router}/RouterExamples.java | 2 +- .../{ => openapi/router}/package-info.java | 2 +- vertx-web-proxy/src/main/asciidoc/index.adoc | 12 +- .../{ => proxy}/WebProxyExamples.java | 2 +- .../examples/{ => proxy}/package-info.java | 2 +- .../src/main/asciidoc/index.adoc | 18 +-- .../WebValidationExamples.java | 2 +- 23 files changed, 130 insertions(+), 134 deletions(-) rename vertx-web-api-service/src/main/java/examples/{ => api/service}/ApiCodegenExamples.java (99%) rename vertx-web-api-service/src/main/java/examples/{ => api/service}/OpenAPIExamples.java (97%) rename vertx-web-api-service/src/main/java/examples/{ => api/service}/TransactionService.java (86%) rename vertx-web-api-service/src/main/java/examples/{ => api/service}/TransactionServiceImpl.java (88%) rename vertx-web-api-service/src/main/java/examples/{ => api/service}/package-info.java (84%) rename vertx-web-client/src/main/java/examples/{ => client}/CachingWebClientExamples.java (98%) rename vertx-web-client/src/main/java/examples/{ => client}/WebClientExamples.java (99%) rename vertx-web-client/src/main/java/examples/{ => client}/WebClientOauth2Examples.java (98%) rename vertx-web-client/src/main/java/examples/{ => client}/WebClientSessionExamples.java (94%) rename vertx-web-client/src/main/java/examples/{ => client}/package-info.java (61%) rename vertx-web-graphql/src/main/java/examples/{ => graphql}/GraphQLExamples.java (99%) rename vertx-web-graphql/src/main/java/examples/{ => graphql}/package-info.java (96%) rename vertx-web-openapi-router/src/main/java/examples/{ => openapi/router}/RouterExamples.java (99%) rename vertx-web-openapi-router/src/main/java/examples/{ => openapi/router}/package-info.java (77%) rename vertx-web-proxy/src/main/java/examples/{ => proxy}/WebProxyExamples.java (99%) rename vertx-web-proxy/src/main/java/examples/{ => proxy}/package-info.java (82%) rename vertx-web-validation/src/main/java/examples/{ => validation}/WebValidationExamples.java (99%) diff --git a/vertx-web-api-service/src/main/asciidoc/index.adoc b/vertx-web-api-service/src/main/asciidoc/index.adoc index 2eb9fbd694..2dfe569805 100644 --- a/vertx-web-api-service/src/main/asciidoc/index.adoc +++ b/vertx-web-api-service/src/main/asciidoc/index.adoc @@ -65,14 +65,14 @@ This handler sends some data extracted from {@link io.vertx.ext.web.RoutingConte [source,$lang] ---- -{@link examples.ApiCodegenExamples#mountHandler} +{@link examples.api.service.ApiCodegenExamples#mountHandler} ---- You can also define the {@link io.vertx.core.eventbus.DeliveryOptions} that will be used each time a message is sent through the event bus: [source,$lang] ---- -{@link examples.ApiCodegenExamples#mountHandlerWithTimeout} +{@link examples.api.service.ApiCodegenExamples#mountHandlerWithTimeout} ---- IMPORTANT: Before mounting the {@link io.vertx.ext.web.api.service.RouteToEBServiceHandler}, you *must* mount a @@ -87,7 +87,7 @@ Let's assume we have defined two different routes in our {@link io.vertx.ext.web [source,$lang] ---- -{@link examples.ApiCodegenExamples#serviceMountExample} +{@link examples.api.service.ApiCodegenExamples#serviceMountExample} ---- `GET /api/transactions` receives two optional query parameters as input: `from` and `to`. `PUT /api/transactions` receives a {@link io.vertx.core.json.JsonObject} as request body @@ -147,14 +147,14 @@ For example the implementation of `TransactionService#getTransactionsList` looks [source,$lang] ---- -{@link examples.ApiCodegenExamples#implGetTransactionsListSuccess} +{@link examples.api.service.ApiCodegenExamples#implGetTransactionsListSuccess} ---- Or when it fails: [source,$lang] ---- -{@link examples.ApiCodegenExamples#implGetTransactionsListFailure} +{@link examples.api.service.ApiCodegenExamples#implGetTransactionsListFailure} ---- === The `ServiceRequest` data object @@ -184,7 +184,7 @@ Now you can register your service to event bus: [source,$lang] ---- -{@link examples.ApiCodegenExamples#serviceMount} +{@link examples.api.service.ApiCodegenExamples#serviceMount} ---- For more info on how to expose your service look at https://vertx.io/docs/vertx-service-proxy/java/#_exposing_your_service[Vert.x service proxy documentation] @@ -196,7 +196,7 @@ The validation of this {@link io.vertx.ext.web.openapi.router.OpenAPIRoute} *MUS [source,$lang] ---- -{@link examples.OpenAPIExamples#addHandler} +{@link examples.api.service.OpenAPIExamples#addHandler} ---- === OpenAPI contract extension diff --git a/vertx-web-api-service/src/main/java/examples/ApiCodegenExamples.java b/vertx-web-api-service/src/main/java/examples/api/service/ApiCodegenExamples.java similarity index 99% rename from vertx-web-api-service/src/main/java/examples/ApiCodegenExamples.java rename to vertx-web-api-service/src/main/java/examples/api/service/ApiCodegenExamples.java index 616c3d307b..0c4ae89ec8 100644 --- a/vertx-web-api-service/src/main/java/examples/ApiCodegenExamples.java +++ b/vertx-web-api-service/src/main/java/examples/api/service/ApiCodegenExamples.java @@ -1,4 +1,4 @@ -package examples; +package examples.api.service; import io.vertx.core.AsyncResult; import io.vertx.core.Future; diff --git a/vertx-web-api-service/src/main/java/examples/OpenAPIExamples.java b/vertx-web-api-service/src/main/java/examples/api/service/OpenAPIExamples.java similarity index 97% rename from vertx-web-api-service/src/main/java/examples/OpenAPIExamples.java rename to vertx-web-api-service/src/main/java/examples/api/service/OpenAPIExamples.java index c304effca0..77c73a5d05 100644 --- a/vertx-web-api-service/src/main/java/examples/OpenAPIExamples.java +++ b/vertx-web-api-service/src/main/java/examples/api/service/OpenAPIExamples.java @@ -10,7 +10,7 @@ * */ -package examples; +package examples.api.service; import io.vertx.core.Vertx; import io.vertx.docgen.Source; diff --git a/vertx-web-api-service/src/main/java/examples/TransactionService.java b/vertx-web-api-service/src/main/java/examples/api/service/TransactionService.java similarity index 86% rename from vertx-web-api-service/src/main/java/examples/TransactionService.java rename to vertx-web-api-service/src/main/java/examples/api/service/TransactionService.java index b712af446a..1acebbfd16 100644 --- a/vertx-web-api-service/src/main/java/examples/TransactionService.java +++ b/vertx-web-api-service/src/main/java/examples/api/service/TransactionService.java @@ -1,8 +1,6 @@ -package examples; +package examples.api.service; -import io.vertx.core.AsyncResult; import io.vertx.core.Future; -import io.vertx.core.Handler; import io.vertx.core.json.JsonObject; import io.vertx.ext.web.api.service.ServiceRequest; import io.vertx.ext.web.api.service.ServiceResponse; diff --git a/vertx-web-api-service/src/main/java/examples/TransactionServiceImpl.java b/vertx-web-api-service/src/main/java/examples/api/service/TransactionServiceImpl.java similarity index 88% rename from vertx-web-api-service/src/main/java/examples/TransactionServiceImpl.java rename to vertx-web-api-service/src/main/java/examples/api/service/TransactionServiceImpl.java index 6e21be92f6..5a01441fd7 100644 --- a/vertx-web-api-service/src/main/java/examples/TransactionServiceImpl.java +++ b/vertx-web-api-service/src/main/java/examples/api/service/TransactionServiceImpl.java @@ -1,8 +1,6 @@ -package examples; +package examples.api.service; -import io.vertx.core.AsyncResult; import io.vertx.core.Future; -import io.vertx.core.Handler; import io.vertx.core.json.JsonObject; import io.vertx.ext.web.api.service.ServiceRequest; import io.vertx.ext.web.api.service.ServiceResponse; diff --git a/vertx-web-api-service/src/main/java/examples/package-info.java b/vertx-web-api-service/src/main/java/examples/api/service/package-info.java similarity index 84% rename from vertx-web-api-service/src/main/java/examples/package-info.java rename to vertx-web-api-service/src/main/java/examples/api/service/package-info.java index db9edda970..e80a7deee3 100644 --- a/vertx-web-api-service/src/main/java/examples/package-info.java +++ b/vertx-web-api-service/src/main/java/examples/api/service/package-info.java @@ -1,6 +1,6 @@ @Source(translate = false) @ModuleGen(name = "examples", groupPackage = "examples") -package examples; +package examples.api.service; import io.vertx.codegen.annotations.ModuleGen; import io.vertx.docgen.Source; diff --git a/vertx-web-client/src/main/asciidoc/index.adoc b/vertx-web-client/src/main/asciidoc/index.adoc index 5dd30dd841..86ff5354f8 100644 --- a/vertx-web-client/src/main/asciidoc/index.adoc +++ b/vertx-web-client/src/main/asciidoc/index.adoc @@ -57,14 +57,14 @@ You create an {@link io.vertx.ext.web.client.WebClient} instance with default op [source,$lang] ---- -{@link examples.WebClientExamples#create} +{@link examples.client.WebClientExamples#create} ---- If you want to configure options for the client, you create it as follows [source,$lang] ---- -{@link examples.WebClientExamples#createFromOptions} +{@link examples.client.WebClientExamples#createFromOptions} ---- Web Client options inherit Http Client options so you can set any one of them. @@ -73,7 +73,7 @@ If your already have an HTTP Client in your application you can also reuse it [source,$lang] ---- -{@link examples.WebClientExamples#wrap(io.vertx.core.http.HttpClient)} +{@link examples.client.WebClientExamples#wrap(io.vertx.core.http.HttpClient)} ---- IMPORTANT: In most cases, a Web Client should be created once on application startup and then reused. @@ -88,28 +88,28 @@ and HEAD requests [source,$lang] ---- -{@link examples.WebClientExamples#simpleGetAndHead} +{@link examples.client.WebClientExamples#simpleGetAndHead} ---- You can add query parameters to the request URI in a fluent fashion [source,$lang] ---- -{@link examples.WebClientExamples#simpleGetWithParams(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#simpleGetWithParams(io.vertx.ext.web.client.WebClient)} ---- Any request URI parameter will pre-populate the request [source,$lang] ---- -{@link examples.WebClientExamples#simpleGetWithInitialParams(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#simpleGetWithInitialParams(io.vertx.ext.web.client.WebClient)} ---- Setting a request URI discards existing query parameters [source,$lang] ---- -{@link examples.WebClientExamples#simpleGetOverwritePreviousParams(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#simpleGetOverwritePreviousParams(io.vertx.ext.web.client.WebClient)} ---- === Writing request bodies @@ -121,7 +121,7 @@ Use {@link io.vertx.ext.web.client.HttpRequest#sendBuffer} to send a buffer body [source,$lang] ---- -{@link examples.WebClientExamples#sendBuffer(io.vertx.ext.web.client.WebClient, io.vertx.core.buffer.Buffer)} +{@link examples.client.WebClientExamples#sendBuffer(io.vertx.ext.web.client.WebClient, io.vertx.core.buffer.Buffer)} ---- Sending a single buffer is useful but often you don't want to load fully the content in memory because @@ -131,7 +131,7 @@ for each request. For this purpose the Web Client can send `ReadStream` [source,$lang] ---- -{@link examples.WebClientExamples#sendStreamChunked(io.vertx.ext.web.client.WebClient, io.vertx.core.streams.ReadStream)} +{@link examples.client.WebClientExamples#sendStreamChunked(io.vertx.ext.web.client.WebClient, io.vertx.core.streams.ReadStream)} ---- The Web Client takes care of setting up the transfer pump for you. Since the length of the stream is not know @@ -141,7 +141,7 @@ When you know the size of the stream, you shall specify before using the `conten [source,$lang] ---- -{@link examples.WebClientExamples#sendStream(io.vertx.ext.web.client.WebClient, io.vertx.core.file.FileSystem)} +{@link examples.client.WebClientExamples#sendStream(io.vertx.ext.web.client.WebClient, io.vertx.core.file.FileSystem)} ---- The POST will not be chunked. @@ -153,7 +153,7 @@ use the {@link io.vertx.ext.web.client.HttpRequest#sendJsonObject(io.vertx.core. [source,$lang] ---- -{@link examples.WebClientExamples#sendJsonObject(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#sendJsonObject(io.vertx.ext.web.client.WebClient)} ---- In Java, Groovy or Kotlin, you can use the {@link io.vertx.ext.web.client.HttpRequest#sendJson} method that maps @@ -162,7 +162,7 @@ method [source,$lang] ---- -{@link examples.WebClientExamples#sendJsonPOJO(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#sendJsonPOJO(io.vertx.ext.web.client.WebClient)} ---- NOTE: the {@link io.vertx.core.json.Json#encode(java.lang.Object)} uses the Jackson mapper to encode the object @@ -175,7 +175,7 @@ variant. [source,$lang] ---- -{@link examples.WebClientExamples#sendForm(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#sendForm(io.vertx.ext.web.client.WebClient)} ---- By default the form is submitted with the `application/x-www-form-urlencoded` content type header. You can set @@ -183,7 +183,7 @@ the `content-type` header to `multipart/form-data` instead [source,$lang] ---- -{@link examples.WebClientExamples#sendMultipart(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#sendMultipart(io.vertx.ext.web.client.WebClient)} ---- If you want to upload files and send attributes, you can create a {@link io.vertx.ext.web.multipart.MultipartForm} and @@ -191,7 +191,7 @@ If you want to upload files and send attributes, you can create a {@link io.vert [source,$lang] ---- -{@link examples.WebClientExamples#sendMultipartWithFileUpload(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#sendMultipartWithFileUpload(io.vertx.ext.web.client.WebClient)} ---- === Writing request headers @@ -200,7 +200,7 @@ You can write headers to a request using the headers multi-map as follows: [source,$lang] ---- -{@link examples.WebClientExamples#sendHeaders1(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#sendHeaders1(io.vertx.ext.web.client.WebClient)} ---- The headers are an instance of {@link io.vertx.core.MultiMap} which provides operations for adding, @@ -210,7 +210,7 @@ You can also write headers using putHeader [source,$lang] ---- -{@link examples.WebClientExamples#sendHeaders2(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#sendHeaders2(io.vertx.ext.web.client.WebClient)} ---- === Configure the request to add authentication. @@ -225,7 +225,7 @@ You can configure the request to add basic access authentication as follows: [source,$lang] ---- -{@link examples.WebClientExamples#addBasicAccessAuthentication(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#addBasicAccessAuthentication(io.vertx.ext.web.client.WebClient)} ---- In OAuth 2.0, a request contains a header field of the form `Authorization: Bearer `, @@ -235,7 +235,7 @@ You can configure the request to add bearer token authentication as follows: [source,$lang] ---- -{@link examples.WebClientExamples#addBearerTokenAuthentication(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#addBearerTokenAuthentication(io.vertx.ext.web.client.WebClient)} ---- === Reusing requests @@ -245,7 +245,7 @@ safely, making it very easy to configure and reuse {@link io.vertx.ext.web.clien [source,$lang] ---- -{@link examples.WebClientExamples#multiGet(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#multiGet(io.vertx.ext.web.client.WebClient)} ---- Beware though that {@link io.vertx.ext.web.client.HttpRequest} instances are mutable. @@ -253,7 +253,7 @@ Therefore you should call the {@link io.vertx.ext.web.client.HttpRequest#copy()} [source,$lang] ---- -{@link examples.WebClientExamples#multiGetCopy(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#multiGetCopy(io.vertx.ext.web.client.WebClient)} ---- === Timeouts @@ -262,7 +262,7 @@ You can set a connect timeout for a specific http request using {@link io.vertx [source,$lang] ---- -{@link examples.WebClientExamples#connectTimeout(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#connectTimeout(io.vertx.ext.web.client.WebClient)} ---- If the client cannot obtain a connection to the server within the timeout period an exception will be passed to the response @@ -272,7 +272,7 @@ You can set an idle timeout for a specific http request using {@link io.vertx.e [source,$lang] ---- -{@link examples.WebClientExamples#idleTimeout(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#idleTimeout(io.vertx.ext.web.client.WebClient)} ---- If the request does not return any data within the timeout period an exception will be passed to the response @@ -282,7 +282,7 @@ You can set both timeouts using {@link io.vertx.ext.web.client.HttpRequest#timeo [source,$lang] ---- -{@link examples.WebClientExamples#timeout(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#timeout(io.vertx.ext.web.client.WebClient)} ---- @@ -294,7 +294,7 @@ On a success result the callback happens after the response has been received [source,$lang] ---- -{@link examples.WebClientExamples#receiveResponse(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#receiveResponse(io.vertx.ext.web.client.WebClient)} ---- [CAUTION] @@ -326,14 +326,14 @@ Use {@link io.vertx.ext.web.codec.BodyCodec#jsonObject()} To decode a Json objec [source,$lang] ---- -{@link examples.WebClientExamples#receiveResponseAsJsonObject(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#receiveResponseAsJsonObject(io.vertx.ext.web.client.WebClient)} ---- In Java, Groovy or Kotlin, custom Json mapped POJO can be decoded [source,$lang] ---- -{@link examples.WebClientExamples#receiveResponseAsJsonPOJO(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#receiveResponseAsJsonPOJO(io.vertx.ext.web.client.WebClient)} ---- When large response are expected, use the {@link io.vertx.ext.web.codec.BodyCodec#pipe(io.vertx.core.streams.WriteStream)}. @@ -342,7 +342,7 @@ and signals the success or the failure of the operation in the async result resp [source,$lang] ---- -{@link examples.WebClientExamples#receiveResponseAsWriteStream(io.vertx.ext.web.client.WebClient, io.vertx.core.streams.WriteStream)} +{@link examples.client.WebClientExamples#receiveResponseAsWriteStream(io.vertx.ext.web.client.WebClient, io.vertx.core.streams.WriteStream)} ---- It becomes frequent to see API returning a stream of JSON objects. For example, the Twitter API can provides a feed of @@ -351,7 +351,7 @@ You pass a JSON parser that emits the read JSON streams from the HTTP response: [source,$lang] ---- -{@link examples.WebClientExamples#receiveResponseAsJsonStream(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#receiveResponseAsJsonStream(io.vertx.ext.web.client.WebClient)} ---- Finally if you are not interested at all by the response content, the {@link io.vertx.ext.web.codec.BodyCodec#none()} @@ -359,7 +359,7 @@ simply discards the entire response body [source,$lang] ---- -{@link examples.WebClientExamples#receiveResponseAndDiscard(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#receiveResponseAndDiscard(io.vertx.ext.web.client.WebClient)} ---- When you don't know in advance the content type of the http response, you can still use the `bodyAsXXX()` methods @@ -367,7 +367,7 @@ that decode the response to a specific type [source,$lang] ---- -{@link examples.WebClientExamples#receiveResponseAsBufferDecodeAsJsonObject(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#receiveResponseAsBufferDecodeAsJsonObject(io.vertx.ext.web.client.WebClient)} ---- WARNING: this is only valid for the response decoded as a buffer. @@ -377,7 +377,7 @@ WARNING: this is only valid for the response decoded as a buffer. Using a specific body codec: {@link io.vertx.ext.web.codec.impl.SseBodyCodec}, you can decode a Server-Sent Events stream into a list of events: [source,$lang] ---- -{@link examples.WebClientExamples#receiveResponseAsServerSentEvents} +{@link examples.client.WebClientExamples#receiveResponseAsServerSentEvents} ---- [[http-response-expectations]] === Response expectations @@ -388,7 +388,7 @@ In other words, you must perform sanity checks manually after the response is re [source,$lang] ---- -{@link examples.WebClientExamples#manualSanityChecks(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#manualSanityChecks(io.vertx.ext.web.client.WebClient)} ---- You can trade flexibility for clarity and conciseness using _response expectations_. @@ -400,14 +400,14 @@ The Web Client can reuse the Vert.x HTTP Client predefined expectations: [source,$lang] ---- -{@link examples.WebClientExamples#usingPredefinedPredicates(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#usingPredefinedPredicates(io.vertx.ext.web.client.WebClient)} ---- You can also create custom expectations when existing expectations don't fit your needs: [source,$lang] ---- -{@link examples.WebClientExamples#usingPredicates(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#usingPredicates(io.vertx.ext.web.client.WebClient)} ---- ==== Predefined expectations @@ -420,7 +420,7 @@ response has a `2xx` code, you can also create a custom one: [source,$lang] ---- -{@link examples.WebClientExamples#usingSpecificStatus(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#usingSpecificStatus(io.vertx.ext.web.client.WebClient)} ---- For content types, e.g. {@link io.vertx.core.http.HttpResponseExpectation#JSON} to verify that the @@ -428,7 +428,7 @@ response body contains JSON data, you can also create a custom one: [source,$lang] ---- -{@link examples.WebClientExamples#usingSpecificContentType(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#usingSpecificContentType(io.vertx.ext.web.client.WebClient)} ---- Please refer to the {@link io.vertx.core.http.HttpResponseExpectation} documentation for a full list of predefined predicates. @@ -441,7 +441,7 @@ the body and conveys a simple message. You can customize the exception class by [source,$lang] ---- -{@link examples.WebClientExamples#predicateCustomError()} +{@link examples.client.WebClientExamples#predicateCustomError()} ---- Many web APIs provide details in error responses. @@ -459,7 +459,7 @@ To avoid losing this information, it is possible to transform response body: [source,$lang] ---- -{@link examples.WebClientExamples#predicateCustomErrorWithBody()} +{@link examples.client.WebClientExamples#predicateCustomErrorWithBody()} ---- WARNING: creating exception in Java can have a performance cost when it captures a stack trace, so you might want @@ -474,14 +474,14 @@ By default the client follows redirections, you can configure the default behavi [source,$lang] ---- -{@link examples.WebClientExamples#testClientDisableFollowRedirects(io.vertx.core.Vertx)} +{@link examples.client.WebClientExamples#testClientDisableFollowRedirects(io.vertx.core.Vertx)} ---- The client will follow at most `16` requests redirections, it can be changed in the same options: [source,$lang] ---- -{@link examples.WebClientExamples#testClientChangeMaxRedirects(io.vertx.core.Vertx)} +{@link examples.client.WebClientExamples#testClientChangeMaxRedirects(io.vertx.core.Vertx)} ---- NOTE: For security reason, client won't follow redirects for request with methods different from GET or HEAD @@ -494,7 +494,7 @@ The client can be configured to perform client side load balancing instead [source,$lang] ---- -{@link examples.WebClientExamples#clientSideLoadBalancing} +{@link examples.client.WebClientExamples#clientSideLoadBalancing} ---- Vert.x provides out of the box several load balancing policies you can use @@ -510,7 +510,7 @@ Hash based routing can be achieved with the {@link io.vertx.core.net.endpoint.Lo [source,$lang] ---- -{@link examples.WebClientExamples#clientSideLoadBalancing} +{@link examples.client.WebClientExamples#clientSideLoadBalancing} ---- You can read more details about client side load balancing in the Vert.x Core HTTP client documentation. @@ -523,7 +523,7 @@ Vert.x web offers an HTTP response caching facility; to use it, you create a {@l [source,$lang] ---- -{@link examples.CachingWebClientExamples#create(io.vertx.core.Vertx)} +{@link examples.client.CachingWebClientExamples#create(io.vertx.core.Vertx)} ---- === Configuring what is cached @@ -535,7 +535,7 @@ This can be configured by passing {@link io.vertx.ext.web.client.CachingWebClien [source,$lang] ---- -{@link examples.CachingWebClientExamples#createWithOptions(io.vertx.core.Vertx)} +{@link examples.client.CachingWebClientExamples#createWithOptions(io.vertx.core.Vertx)} ---- Responses that contain the `private` directive in the `Cache-Control` header will not be cached unless the client is also @@ -548,7 +548,7 @@ To do so, implement {@link io.vertx.ext.web.client.spi.CacheStore}, and then you [source,$lang] ---- -{@link examples.CachingWebClientExamples#createWithCustomStore(io.vertx.core.Vertx)} +{@link examples.client.CachingWebClientExamples#createWithCustomStore(io.vertx.core.Vertx)} ---- === Handling private responses @@ -564,7 +564,7 @@ a {@link io.vertx.ext.web.client.WebClientSession}. [source,$lang] ---- -{@link examples.CachingWebClientExamples#createWithSession(io.vertx.core.Vertx)} +{@link examples.client.CachingWebClientExamples#createWithSession(io.vertx.core.Vertx)} ---- == URI templates @@ -586,28 +586,28 @@ then use it to create a request [source,$lang] ---- -{@link examples.WebClientExamples#testUriTemplate1} +{@link examples.client.WebClientExamples#testUriTemplate1} ---- set the template parameter [source,$lang] ---- -{@link examples.WebClientExamples#testUriTemplate2} +{@link examples.client.WebClientExamples#testUriTemplate2} ---- and finally send the request as usual [source,$lang] ---- -{@link examples.WebClientExamples#testUriTemplate3} +{@link examples.client.WebClientExamples#testUriTemplate3} ---- or fluently [source,$lang] ---- -{@link examples.WebClientExamples#testUriTemplateFluent} +{@link examples.client.WebClientExamples#testUriTemplateFluent} ---- === URI templates expansion @@ -618,7 +618,7 @@ String expansion takes care of encoding the parameters for you, [source,$lang] ---- -{@link examples.WebClientExamples#testUriTemplateEncoding} +{@link examples.client.WebClientExamples#testUriTemplateEncoding} ---- The default expansion syntax is known as _simple string expansion_, there are other expansion syntax available @@ -634,7 +634,7 @@ this behavior to fail instead: [source,$lang] ---- -{@link examples.WebClientExamples#testConfigureTemplateExpansion} +{@link examples.client.WebClientExamples#testConfigureTemplateExpansion} ---- === Template parameter values @@ -646,7 +646,7 @@ The expansion of each kind depends on the expansion style (denoted by the `?` pr [source,$lang] ---- -{@link examples.WebClientExamples#testUriTemplateMapExpansion} +{@link examples.client.WebClientExamples#testUriTemplateMapExpansion} ---- Form-style query expansion expands the variable `{?query*}` as `?color=red&width=30&height=50` per definition. @@ -659,14 +659,14 @@ You can specify the behavior per request [source,$lang] ---- -{@link examples.WebClientExamples#testOverrideRequestSSL(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#testOverrideRequestSSL(io.vertx.ext.web.client.WebClient)} ---- Or using create methods with absolute URI argument [source,$lang] ---- -{@link examples.WebClientExamples#testAbsRequestSSL(io.vertx.ext.web.client.WebClient)} +{@link examples.client.WebClientExamples#testAbsRequestSSL(io.vertx.ext.web.client.WebClient)} ---- == Sessions management @@ -681,7 +681,7 @@ You create a {@link io.vertx.ext.web.client.WebClientSession} instance as follow [source,$lang] ---- -{@link examples.WebClientSessionExamples#create} +{@link examples.client.WebClientSessionExamples#create} ---- === Making requests @@ -696,7 +696,7 @@ You can set any session level headers to be added to every request as follows: [source,$lang] ---- -{@link examples.WebClientSessionExamples#setHeaders} +{@link examples.client.WebClientSessionExamples#setHeaders} ---- The headers will then be added to every request; notice that these headers will be sent to all hosts; if you need @@ -715,7 +715,7 @@ You create a {@link io.vertx.ext.web.client.OAuth2WebClient} instance as follows [source,$lang] ---- -{@link examples.WebClientOauth2Examples#create} +{@link examples.client.WebClientOauth2Examples#create} ---- Client's can also take advantage of OpenId Service discovery to fully configure the client, for example to connect to @@ -723,7 +723,7 @@ a real keycloak server one can just do: [source,$lang] ---- -{@link examples.WebClientOauth2Examples#discovery} +{@link examples.client.WebClientOauth2Examples#discovery} ---- @@ -739,7 +739,7 @@ You can set token expiration leeway to every request as follows: [source,$lang] ---- -{@link examples.WebClientOauth2Examples#leeway} +{@link examples.client.WebClientOauth2Examples#leeway} ---- If a request is to be performed the current active user object is checked for expiration with the extra given leeway. @@ -753,7 +753,7 @@ handler/promise. [source,$lang] ---- -{@link examples.WebClientOauth2Examples#renewTokenOnForbidden} +{@link examples.client.WebClientOauth2Examples#renewTokenOnForbidden} ---- @@ -770,5 +770,5 @@ To achieve this, you must run your application with JDK16+ or create the {@link [source,$lang] ---- -{@link examples.WebClientExamples#testSocketAddress} +{@link examples.client.WebClientExamples#testSocketAddress} ---- diff --git a/vertx-web-client/src/main/java/examples/CachingWebClientExamples.java b/vertx-web-client/src/main/java/examples/client/CachingWebClientExamples.java similarity index 98% rename from vertx-web-client/src/main/java/examples/CachingWebClientExamples.java rename to vertx-web-client/src/main/java/examples/client/CachingWebClientExamples.java index 486473d799..7a4d1128ea 100644 --- a/vertx-web-client/src/main/java/examples/CachingWebClientExamples.java +++ b/vertx-web-client/src/main/java/examples/client/CachingWebClientExamples.java @@ -1,4 +1,4 @@ -package examples; +package examples.client; import io.vertx.core.Vertx; import io.vertx.core.http.HttpHeaders; diff --git a/vertx-web-client/src/main/java/examples/WebClientExamples.java b/vertx-web-client/src/main/java/examples/client/WebClientExamples.java similarity index 99% rename from vertx-web-client/src/main/java/examples/WebClientExamples.java rename to vertx-web-client/src/main/java/examples/client/WebClientExamples.java index 5d81a2d754..2a3db3c634 100644 --- a/vertx-web-client/src/main/java/examples/WebClientExamples.java +++ b/vertx-web-client/src/main/java/examples/client/WebClientExamples.java @@ -14,7 +14,7 @@ * under the License. */ -package examples; +package examples.client; import io.vertx.core.Expectation; import io.vertx.core.Future; diff --git a/vertx-web-client/src/main/java/examples/WebClientOauth2Examples.java b/vertx-web-client/src/main/java/examples/client/WebClientOauth2Examples.java similarity index 98% rename from vertx-web-client/src/main/java/examples/WebClientOauth2Examples.java rename to vertx-web-client/src/main/java/examples/client/WebClientOauth2Examples.java index c9bde12ed9..fb22479c04 100644 --- a/vertx-web-client/src/main/java/examples/WebClientOauth2Examples.java +++ b/vertx-web-client/src/main/java/examples/client/WebClientOauth2Examples.java @@ -1,4 +1,4 @@ -package examples; +package examples.client; import io.vertx.core.Vertx; import io.vertx.ext.auth.authentication.TokenCredentials; diff --git a/vertx-web-client/src/main/java/examples/WebClientSessionExamples.java b/vertx-web-client/src/main/java/examples/client/WebClientSessionExamples.java similarity index 94% rename from vertx-web-client/src/main/java/examples/WebClientSessionExamples.java rename to vertx-web-client/src/main/java/examples/client/WebClientSessionExamples.java index 8b6444e595..9028a7883f 100644 --- a/vertx-web-client/src/main/java/examples/WebClientSessionExamples.java +++ b/vertx-web-client/src/main/java/examples/client/WebClientSessionExamples.java @@ -1,4 +1,4 @@ -package examples; +package examples.client; import io.vertx.core.Vertx; import io.vertx.ext.web.client.WebClient; @@ -10,10 +10,10 @@ public void create(Vertx vertx) { WebClient client = WebClient.create(vertx); WebClientSession session = WebClientSession.create(client); } - + public void setHeaders(WebClient client, String jwtToken) { WebClientSession session = WebClientSession.create(client); session.addHeader("my-jwt-token", jwtToken); } - + } diff --git a/vertx-web-client/src/main/java/examples/package-info.java b/vertx-web-client/src/main/java/examples/client/package-info.java similarity index 61% rename from vertx-web-client/src/main/java/examples/package-info.java rename to vertx-web-client/src/main/java/examples/client/package-info.java index bd17562076..838b324765 100644 --- a/vertx-web-client/src/main/java/examples/package-info.java +++ b/vertx-web-client/src/main/java/examples/client/package-info.java @@ -1,4 +1,4 @@ @Source -package examples; +package examples.client; import io.vertx.docgen.Source; diff --git a/vertx-web-graphql/src/main/asciidoc/index.adoc b/vertx-web-graphql/src/main/asciidoc/index.adoc index 40a71f22ec..10a24e5b16 100644 --- a/vertx-web-graphql/src/main/asciidoc/index.adoc +++ b/vertx-web-graphql/src/main/asciidoc/index.adoc @@ -34,7 +34,7 @@ Create a Vert.x Web {@link io.vertx.ext.web.Route} and a {@link io.vertx.ext.web [source,$lang] ---- -{@link examples.GraphQLExamples#handlerSetup} +{@link examples.graphql.GraphQLExamples#handlerSetup} ---- [TIP] @@ -43,7 +43,7 @@ The `GraphQLHandler` supports https://www.apollographql.com/docs/apollo-server/p [source,$lang] ---- -{@link examples.GraphQLExamples#persistedQueries} +{@link examples.graphql.GraphQLExamples#persistedQueries} ---- ==== @@ -52,7 +52,7 @@ However, you can restrict the service to one type of HTTP method: [source,$lang] ---- -{@link examples.GraphQLExamples#handlerSetupPost} +{@link examples.graphql.GraphQLExamples#handlerSetupPost} ---- IMPORTANT: The {@link io.vertx.ext.web.handler.graphql.GraphQLHandler} requires a {@link io.vertx.ext.web.handler.BodyHandler} to read `POST` requests content. @@ -66,7 +66,7 @@ To enable it, create the {@link io.vertx.ext.web.handler.graphql.GraphQLHandler} [source,$lang] ---- -{@link examples.GraphQLExamples#handlerSetupBatching} +{@link examples.graphql.GraphQLExamples#handlerSetupBatching} ---- === GraphQL over WebSocket @@ -82,7 +82,7 @@ This check is important because WebSockets are not restrained by the same-origin [source,$lang] ---- -{@link examples.GraphQLExamples#addGraphQLWSHandlerToRouter} +{@link examples.graphql.GraphQLExamples#addGraphQLWSHandlerToRouter} ---- [IMPORTANT] @@ -92,7 +92,7 @@ Consequently, it has to be added to the list of supported subprotocols in the se [source,$lang] ---- -{@link examples.GraphQLExamples#configureServerForGraphQLWS} +{@link examples.graphql.GraphQLExamples#configureServerForGraphQLWS} ---- ==== @@ -102,7 +102,7 @@ The `GraphQLWSHandler` supports https://www.apollographql.com/docs/apollo-server [source,$lang] ---- -{@link examples.GraphQLExamples#persistedQueries} +{@link examples.graphql.GraphQLExamples#persistedQueries} ---- ==== @@ -110,7 +110,7 @@ To support both HTTP and Websockets on the same URI, the {@link io.vertx.ext.web [source,$lang] ---- -{@link examples.GraphQLExamples#configureGraphQLWSAndHttpOnSamePath} +{@link examples.graphql.GraphQLExamples#configureGraphQLWSAndHttpOnSamePath} ---- IMPORTANT: A _subscription_ `DataFetcher` has to return a `org.reactivestreams.Publisher` instance. @@ -123,7 +123,7 @@ To do so, create a route for GraphiQL resources and a {@link io.vertx.ext.web.ha [source,$lang] ---- -{@link examples.GraphQLExamples#handlerSetupGraphiQL} +{@link examples.graphql.GraphQLExamples#handlerSetupGraphiQL} ---- Then browse to http://localhost:8080/graphiql/. @@ -142,7 +142,7 @@ If your application is protected by authentication, you can customize the header [source,$lang] ---- -{@link examples.GraphQLExamples#handlerSetupGraphiQLAuthn} +{@link examples.graphql.GraphQLExamples#handlerSetupGraphiQLAuthn} ---- Please refer to the {@link io.vertx.ext.web.handler.graphql.GraphiQLHandlerOptions} documentation for further details. @@ -155,7 +155,7 @@ To https://vertx.io/docs/vertx-core/java/#golden_rule[avoid blocking the event l [source,$lang] ---- -{@link examples.GraphQLExamples#completionStageDataFetcher} +{@link examples.graphql.GraphQLExamples#completionStageDataFetcher} ---- [TIP] @@ -166,14 +166,14 @@ First, declare the instrumentation while configuring GraphQL-Java. [source,$lang] ---- -{@link examples.GraphQLExamples#vertxFutureAdapter} +{@link examples.graphql.GraphQLExamples#vertxFutureAdapter} ---- Then you can return Vert.x futures directly. [source,$lang] ---- -{@link examples.GraphQLExamples#futureDataFetcher} +{@link examples.graphql.GraphQLExamples#futureDataFetcher} ---- ==== @@ -188,7 +188,7 @@ For this, you may retrieve the {@link io.vertx.ext.web.RoutingContext} object by [source,$lang] ---- -{@link examples.GraphQLExamples#routingContextInDataFetchingEnvironment} +{@link examples.graphql.GraphQLExamples#routingContextInDataFetchingEnvironment} ---- === JSON data results @@ -209,7 +209,7 @@ Configure GraphQL-Java with the {@link io.vertx.ext.web.handler.graphql.instrume [source,$lang] ---- -{@link examples.GraphQLExamples#jsonObjectAdapter} +{@link examples.graphql.GraphQLExamples#jsonObjectAdapter} ---- === Batch loading @@ -220,14 +220,14 @@ First, create a batch loader: [source,$lang] ---- -{@link examples.GraphQLExamples#createBatchLoader} +{@link examples.graphql.GraphQLExamples#createBatchLoader} ---- Then, configure the {@link io.vertx.ext.web.handler.graphql.GraphQLHandler} to create a `DataLoaderRegistry` for each request: [source,$lang] ---- -{@link examples.GraphQLExamples#dataLoaderRegistry} +{@link examples.graphql.GraphQLExamples#dataLoaderRegistry} ---- === File uploads @@ -240,7 +240,7 @@ To enable it, create a {@link io.vertx.ext.web.handler.graphql.GraphQLHandler} w [source,$lang] ---- -{@link examples.GraphQLExamples#setupGraphQLHandlerMultipart} +{@link examples.graphql.GraphQLExamples#setupGraphQLHandlerMultipart} ---- IMPORTANT: If the router does not have a {@link io.vertx.ext.web.handler.BodyHandler}, the multipart request parser will not be able to handle the GraphQL mutation call. @@ -249,12 +249,12 @@ Finally, create the `Upload` scalar and set it to the `RuntimeWiring`: [source,$lang] ---- -{@link examples.GraphQLExamples#setRuntimeScalar} +{@link examples.graphql.GraphQLExamples#setRuntimeScalar} ---- The `FileUpload` instance can be accessed using the `DataFetchingEnvironment::getArgument` method. [source,$lang] ---- -{@link examples.GraphQLExamples#getFileUpload} +{@link examples.graphql.GraphQLExamples#getFileUpload} ---- diff --git a/vertx-web-graphql/src/main/java/examples/GraphQLExamples.java b/vertx-web-graphql/src/main/java/examples/graphql/GraphQLExamples.java similarity index 99% rename from vertx-web-graphql/src/main/java/examples/GraphQLExamples.java rename to vertx-web-graphql/src/main/java/examples/graphql/GraphQLExamples.java index 62c95a6237..c9d78770e2 100644 --- a/vertx-web-graphql/src/main/java/examples/GraphQLExamples.java +++ b/vertx-web-graphql/src/main/java/examples/graphql/GraphQLExamples.java @@ -14,7 +14,7 @@ * under the License. */ -package examples; +package examples.graphql; import graphql.GraphQL; import graphql.execution.preparsed.persisted.ApolloPersistedQuerySupport; diff --git a/vertx-web-graphql/src/main/java/examples/package-info.java b/vertx-web-graphql/src/main/java/examples/graphql/package-info.java similarity index 96% rename from vertx-web-graphql/src/main/java/examples/package-info.java rename to vertx-web-graphql/src/main/java/examples/graphql/package-info.java index 733d3b8d44..6b990c812e 100644 --- a/vertx-web-graphql/src/main/java/examples/package-info.java +++ b/vertx-web-graphql/src/main/java/examples/graphql/package-info.java @@ -18,6 +18,6 @@ * @author Thomas Segismont */ @Source -package examples; +package examples.graphql; import io.vertx.docgen.Source; diff --git a/vertx-web-openapi-router/src/main/asciidoc/index.adoc b/vertx-web-openapi-router/src/main/asciidoc/index.adoc index cbf079ed40..216f5e51d8 100644 --- a/vertx-web-openapi-router/src/main/asciidoc/index.adoc +++ b/vertx-web-openapi-router/src/main/asciidoc/index.adoc @@ -38,7 +38,7 @@ With the {@link io.vertx.ext.web.openapi.router.RouterBuilder} you can easily ge [source,$lang] ---- -{@link examples.RouterExamples#createRouter} +{@link examples.openapi.router.RouterExamples#createRouter} ---- The {@link io.vertx.ext.web.openapi.router.RouterBuilder} provides methods to access the generated routes. @@ -46,14 +46,14 @@ These routes can then be customized by adding custom handlers or enable / disabl [source,$lang] ---- -{@link examples.RouterExamples#modifyRoutes} +{@link examples.openapi.router.RouterExamples#modifyRoutes} ---- After a successful validation of the incoming request, the validated parameters and request body are stored in the RoutingContext and can be accessed inside your custom handlers. [source,$lang] ---- -{@link examples.RouterExamples#accessValidatedRequest} +{@link examples.openapi.router.RouterExamples#accessValidatedRequest} ---- === Define security handlers @@ -72,7 +72,7 @@ For example: [source,$lang] ---- -{@link examples.RouterExamples#securityConfiguration} +{@link examples.openapi.router.RouterExamples#securityConfiguration} ---- Of course Oauth2/openIdConnect are also supported, given that these modes are more complex to configure, instead of providing a simple configuration object, you need to provide a factory that can creates the handler as you need. @@ -80,12 +80,12 @@ The factory will receive the configuration from the contract, or in case of `ope [source,$lang] ---- -{@link examples.RouterExamples#securityConfigurationOauth2} +{@link examples.openapi.router.RouterExamples#securityConfigurationOauth2} ---- Discovery may sound simpler and if you are working with a openId compliant server you can use the the `openIdConnect` security scheme. [source,$lang] ---- -{@link examples.RouterExamples#securityConfigurationOpenIdConnect} +{@link examples.openapi.router.RouterExamples#securityConfigurationOpenIdConnect} ---- diff --git a/vertx-web-openapi-router/src/main/java/examples/RouterExamples.java b/vertx-web-openapi-router/src/main/java/examples/openapi/router/RouterExamples.java similarity index 99% rename from vertx-web-openapi-router/src/main/java/examples/RouterExamples.java rename to vertx-web-openapi-router/src/main/java/examples/openapi/router/RouterExamples.java index 8bc6d9ea88..b54a7978f5 100644 --- a/vertx-web-openapi-router/src/main/java/examples/RouterExamples.java +++ b/vertx-web-openapi-router/src/main/java/examples/openapi/router/RouterExamples.java @@ -1,4 +1,4 @@ -package examples; +package examples.openapi.router; import io.vertx.core.Vertx; import io.vertx.ext.auth.authentication.AuthenticationProvider; diff --git a/vertx-web-openapi-router/src/main/java/examples/package-info.java b/vertx-web-openapi-router/src/main/java/examples/openapi/router/package-info.java similarity index 77% rename from vertx-web-openapi-router/src/main/java/examples/package-info.java rename to vertx-web-openapi-router/src/main/java/examples/openapi/router/package-info.java index 3cd42e8ca3..5b3456a2e5 100644 --- a/vertx-web-openapi-router/src/main/java/examples/package-info.java +++ b/vertx-web-openapi-router/src/main/java/examples/openapi/router/package-info.java @@ -2,5 +2,5 @@ * @author Julien Viet */ @Source -package examples; +package examples.openapi.router; import io.vertx.docgen.Source; diff --git a/vertx-web-proxy/src/main/asciidoc/index.adoc b/vertx-web-proxy/src/main/asciidoc/index.adoc index 4bec2918f1..45c6c02601 100644 --- a/vertx-web-proxy/src/main/asciidoc/index.adoc +++ b/vertx-web-proxy/src/main/asciidoc/index.adoc @@ -45,7 +45,7 @@ listens to port `7070` [source,$lang] ---- -{@link examples.WebProxyExamples#origin} +{@link examples.proxy.WebProxyExamples#origin} ---- == Proxy Server @@ -54,7 +54,7 @@ Create the *proxy server* that listens to port `8080` [source,$lang] ---- -{@link examples.WebProxyExamples#proxy} +{@link examples.proxy.WebProxyExamples#proxy} ---- == Using `ProxyHandler` @@ -64,14 +64,14 @@ with specified target and `ProxyHandler`. [source,$lang] ---- -{@link examples.WebProxyExamples#route} +{@link examples.proxy.WebProxyExamples#route} ---- Or you can specify the target in `ProxyHandler` instead. [source,$lang] ---- -{@link examples.WebProxyExamples#routeShort} +{@link examples.proxy.WebProxyExamples#routeShort} ---- Finally, the *proxy server* requests will be routed as a reverse proxy to the *origin server* conveniently. @@ -83,7 +83,7 @@ It shouldn't be installed on the same route or a previous route. [source,$lang] ---- -{@link examples.WebProxyExamples#notCompatibleWithBodyHandler} +{@link examples.proxy.WebProxyExamples#notCompatibleWithBodyHandler} ---- ==== @@ -94,5 +94,5 @@ each one and specify the target independently. [source,$lang] ---- -{@link examples.WebProxyExamples#multi} +{@link examples.proxy.WebProxyExamples#multi} ---- diff --git a/vertx-web-proxy/src/main/java/examples/WebProxyExamples.java b/vertx-web-proxy/src/main/java/examples/proxy/WebProxyExamples.java similarity index 99% rename from vertx-web-proxy/src/main/java/examples/WebProxyExamples.java rename to vertx-web-proxy/src/main/java/examples/proxy/WebProxyExamples.java index 91701a5871..54d4b621a0 100644 --- a/vertx-web-proxy/src/main/java/examples/WebProxyExamples.java +++ b/vertx-web-proxy/src/main/java/examples/proxy/WebProxyExamples.java @@ -1,4 +1,4 @@ -package examples; +package examples.proxy; import io.vertx.core.Vertx; import io.vertx.core.http.HttpClient; diff --git a/vertx-web-proxy/src/main/java/examples/package-info.java b/vertx-web-proxy/src/main/java/examples/proxy/package-info.java similarity index 82% rename from vertx-web-proxy/src/main/java/examples/package-info.java rename to vertx-web-proxy/src/main/java/examples/proxy/package-info.java index 3cd42e8ca3..6f3eb556c6 100644 --- a/vertx-web-proxy/src/main/java/examples/package-info.java +++ b/vertx-web-proxy/src/main/java/examples/proxy/package-info.java @@ -2,5 +2,5 @@ * @author Julien Viet */ @Source -package examples; +package examples.proxy; import io.vertx.docgen.Source; diff --git a/vertx-web-validation/src/main/asciidoc/index.adoc b/vertx-web-validation/src/main/asciidoc/index.adoc index 66bcbf6233..4e96764c45 100644 --- a/vertx-web-validation/src/main/asciidoc/index.adoc +++ b/vertx-web-validation/src/main/asciidoc/index.adoc @@ -44,14 +44,14 @@ When you receive an HTTP request, you usually need to perform parsing and valida [source,$lang] ---- -{@link examples.WebValidationExamples#withoutWebValidation} +{@link examples.validation.WebValidationExamples#withoutWebValidation} ---- Vert.x Web Validation provides an easy to use API to build an handler that performs parsing and validation of the request: [source,$lang] ---- -{@link examples.WebValidationExamples#withWebValidation} +{@link examples.validation.WebValidationExamples#withWebValidation} ---- == Creating the `ValidationHandler` @@ -67,7 +67,7 @@ Every parameter is represented by a {@link io.vertx.ext.web.validation.impl.para [source,$lang] ---- -{@link examples.WebValidationExamples#parameters} +{@link examples.validation.WebValidationExamples#parameters} ---- === Defining custom error messages @@ -84,7 +84,7 @@ While header and path parameters allows only simple parameters, query and cookie [source,$lang] ---- -{@link examples.WebValidationExamples#parametersComplex} +{@link examples.validation.WebValidationExamples#parametersComplex} ---- For more info on all available parameters, look at {@link io.vertx.ext.web.validation.builder.Parameters} documentation. @@ -99,7 +99,7 @@ You can easily create these processor with methods provided in {@link io.vertx.e [source,$lang] ---- -{@link examples.WebValidationExamples#bodies} +{@link examples.validation.WebValidationExamples#bodies} ---- In this example the `ValidationHandler` will be able to manage two different body types that consistently parse and validate. @@ -115,7 +115,7 @@ For example, to define a "request body required" predicate: [source,$lang] ---- -{@link examples.WebValidationExamples#requestBodyRequired} +{@link examples.validation.WebValidationExamples#requestBodyRequired} ---- === Building the `ValidationHandler` @@ -124,7 +124,7 @@ After you configured all parameters, bodies and request predicates, you can buil [source,$lang] ---- -{@link examples.WebValidationExamples#buildAndMount} +{@link examples.validation.WebValidationExamples#buildAndMount} ---- == Using the parsed parameters and body @@ -133,7 +133,7 @@ The `ValidationHandler` will place the parsed values into {@link io.vertx.ext.we [source,$lang] ---- -{@link examples.WebValidationExamples#useParameters} +{@link examples.validation.WebValidationExamples#useParameters} ---- == Manage the failures @@ -151,7 +151,7 @@ For example: [source,$lang] ---- -{@link examples.WebValidationExamples#manageFailure} +{@link examples.validation.WebValidationExamples#manageFailure} ---- `BadRequestException` also provides an handy method called {@link io.vertx.ext.web.validation.BadRequestException#toJson()} that converts the exception to a Json diff --git a/vertx-web-validation/src/main/java/examples/WebValidationExamples.java b/vertx-web-validation/src/main/java/examples/validation/WebValidationExamples.java similarity index 99% rename from vertx-web-validation/src/main/java/examples/WebValidationExamples.java rename to vertx-web-validation/src/main/java/examples/validation/WebValidationExamples.java index 62b5cc3b49..6e458b9bd1 100644 --- a/vertx-web-validation/src/main/java/examples/WebValidationExamples.java +++ b/vertx-web-validation/src/main/java/examples/validation/WebValidationExamples.java @@ -1,4 +1,4 @@ -package examples; +package examples.validation; import io.vertx.core.json.JsonArray; import io.vertx.core.json.JsonObject;