Skip to content
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

New style Documentation #4336

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1b0cb9a
Metrics New Style Documentation created
dalexandrov May 16, 2022
848c52d
Tracing New Style Documentation created
dalexandrov May 16, 2022
b47b9c0
JWT New Style Documentation created
dalexandrov May 16, 2022
4bf150a
CORS New Style Documentation created
dalexandrov May 16, 2022
6c5b6a1
Validation New Style Documentation created
dalexandrov May 16, 2022
5d1cd52
JPA New Style Documentation created
dalexandrov May 16, 2022
64dc3fe
LRA New Style Documentation created
dalexandrov May 16, 2022
88ed289
Scheduled New Style Documentation created
dalexandrov May 17, 2022
de48ac1
REST Client New Style Documentation created
dalexandrov May 17, 2022
58ae4df
OpenApi New Style Documentation created
dalexandrov May 17, 2022
a1575b7
Fault tolerance New Style Documentation created
dalexandrov May 18, 2022
2db1d28
gGPC New Style Documentation created
dalexandrov May 18, 2022
19852c3
GraphQL New Style Documentation created
dalexandrov May 18, 2022
56ecb25
WebSocket New Style Documentation created
dalexandrov May 18, 2022
915a344
Reactive streams New Style Documentation created
dalexandrov May 19, 2022
e9445a3
OCI New Style Documentation created
dalexandrov May 19, 2022
8fd6d0d
Vault New Style Documentation created
dalexandrov May 19, 2022
a213027
Micrometer New Style Documentation created
dalexandrov May 19, 2022
45b2ed5
Testing New Style Documentation created
dalexandrov May 19, 2022
80071e8
Config New Style Documentation created
dalexandrov May 23, 2022
5f30501
New Style Documentation clean up
dalexandrov May 23, 2022
13e6b87
SE Configuration New Style Documentation
dalexandrov May 30, 2022
b14fff5
SE Metrics New Style Documentation
dalexandrov May 30, 2022
53fa6d1
SE Tracing New Style Documentation
dalexandrov May 30, 2022
f88ebc2
SE CORS New Style Documentation
dalexandrov May 30, 2022
a096010
SE Scheduling New Style Documentation
dalexandrov May 30, 2022
a47010c
SE DB Client New Style Documentation
dalexandrov May 30, 2022
ae802eb
SE Fault Tolerance New Style Documentation
dalexandrov May 30, 2022
2545d58
SE GraphQL New Style Documentation
dalexandrov May 30, 2022
4d175e0
SE OCI New Style Documentation
dalexandrov May 30, 2022
178a747
SE OpenAPI New Style Documentation
dalexandrov May 31, 2022
f716151
SE Reactive Messaging New Style Documentation
dalexandrov May 31, 2022
4aca5b7
SE Security New Style Documentation
dalexandrov May 31, 2022
73dc92f
SE Vault New Style Documentation
dalexandrov May 31, 2022
19c92f8
SE Web Client New Style Documentation
dalexandrov May 31, 2022
53f3fec
SE Websocket New Style Documentation
dalexandrov May 31, 2022
4d1f57b
SE Reactive operators New Style Documentation
dalexandrov May 31, 2022
8e10107
Clean Up New Style Documentation
dalexandrov Jun 3, 2022
3e2e27c
New style documentation
dalexandrov May 16, 2022
d201723
Merge remote-tracking branch 'origin/documentation' into documentation
dalexandrov Jun 3, 2022
9f2624c
Apply comments by Tim Quinn
dalexandrov Jun 14, 2022
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
77 changes: 71 additions & 6 deletions docs/mp/beanvalidation/01_overview.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2021 Oracle and/or its affiliates.
Copyright (c) 2021, 2022 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -18,20 +18,36 @@

= Bean Validation Introduction
:h1Prefix: MP
:pagename: bean-validation-introduction
:description: Bean Validation Introduction
:pagename: bean-validation
:description: Bean Validation
:keywords: helidon, webserver, bean validation, validation
:bean-validation-spec-url: https://projects.eclipse.org/projects/ee4j.bean-validation
:feature-name: Bean Validation
:common-deps-page-prefix-inc: ../../shared/dependencies/common_shared.adoc

== ToC

- Overview
- Maven Coordinates
- Usage
- API
- Configuration
- Reference
- Examples
- Additional Information

== Overview

Helidon supports Bean Validation via its integration with JAX-RS/Jersey. The
{bean-validation-spec-url}[Jakarta Bean
Validation specification] defines an API to validate Java beans.
Bean Validation is supported in REST resource classes as well as in
regular application beans.

If bean validation is required outside JAX-RS/Jersey use cases, it is also available in Helidon.
It follows the standard {bean-validation-spec-url}[Jakarta Bean
Validation specification] which defines an API to validate Java beans.

include::{common-deps-page-prefix-inc}[tag=maven-dependency]

[source, xml]
Expand All @@ -42,14 +58,32 @@ include::{common-deps-page-prefix-inc}[tag=maven-dependency]
</dependency>
----

== Validation Example in Helidon MP
For general validation, please add to your `pom.xml`:

[source, xml]
----
<dependency>
<groupId>io.helidon.microprofile.bean-validation</groupId>
<artifactId>helidon-microprofile-bean-validation</artifactId>
</dependency>
----

== API

TODO Add API tables with description

== Reference

TODO

== Examples

The following example shows a simple resource method annotated with `@POST` whose
1. The following example shows a simple resource method annotated with `@POST` whose
parameter must be _not null_ and _valid_. Validating a parameter in this case implies
making sure that any constraint annotations in the `Greeting` class are satisfied.
The resource method shall never be called if the validation fails, with a 400
(Bad Request) status code returned instead.

+
[source,java]
----
@Path("helloworld")
Expand All @@ -63,3 +97,34 @@ public class HelloWorld {
}
----

2. The following example shows a simple application with one field declared as _not null_ using `@NotNull` annotation:
+
[source,java]
----
public class GreetingHolder {
@NotNull
private String greeting;
//...
}
----
+
If the bean contains a method parameter annotated with @Valid, and GreetingHolder with _null_greeting is passed, then a _ValidationException_ will be thrown:
+
[source,java]
----
@ApplicationScoped
public class GreetingProvider {
private GreetingHolder greetingHolder;
//..
void setGreeting(@Valid GreetingHolder greetingHolder) {
this.greetingHolder = greetingHolder;
}
}
----
+
NOTE: `beans.xml` is required to identify beans and for bean validation to work properly.


== Additional Information

TODO
71 changes: 0 additions & 71 deletions docs/mp/beanvalidation/02_general_beanvalidation.adoc

This file was deleted.

Loading