Skip to content

Commit 38641cb

Browse files
authored
Update chapter04.adoc
Removed both the "Support for Java records" section and the corresponding bullet from the summary.
1 parent d4cd1fa commit 38641cb

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

modules/ROOT/pages/chapter04/chapter04.adoc

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -523,29 +523,6 @@ OpenAPI v3.1 uses JSON Schema's standard type arrays for nullable fields. Use `@
523523
private String description;
524524
----
525525

526-
=== Support for Java records
527-
528-
MicroProfile OpenAPI 4.1 supports Java records and automatically generates schema definitions from record components:
529-
530-
[source, java]
531-
----
532-
@Schema(name = "Product", description = "Product information")
533-
public record Product(
534-
@NotNull
535-
@Schema(description = "Product ID")
536-
Long id,
537-
538-
@NotNull
539-
@Schema(description = "Product name")
540-
String name,
541-
542-
@Schema(description = "Optional description", nullable = true)
543-
String description
544-
) {}
545-
----
546-
547-
Use `@NotNull` validation annotations to mark required fields. The generated schema includes proper type definitions, required fields, and descriptions from your record components.
548-
549526
== Jakarta Bean Validation integration
550527

551528
MicroProfile OpenAPI automatically processes Jakarta Bean Validation annotations and uses them to enhance the generated OpenAPI schemas. Common validation annotations include:
@@ -711,10 +688,6 @@ You learned to document your RESTful endpoints using core OpenAPI annotations in
711688

712689
You explored MicroProfile OpenAPI's convenience annotations that simplify common documentation tasks. You learned to use `@RequestBodySchema` to document request bodies concisely, `@APIResponseSchema` to document response types efficiently, and `@SchemaProperty` to define inline schema properties without creating separate classes.
713690

714-
*Java records support*
715-
716-
You explored how MicroProfile OpenAPI 4.1 provides native support for Java records, allowing you to use modern, immutable data carriers with automatic schema generation. You learned to combine `@Schema` annotations with `@NotNull` validation to create well-documented, type-safe data models.
717-
718691
*Nullable type handling*
719692

720693
You learned how MicroProfile OpenAPI 4.1 supports improved nullable type handling aligned with OpenAPI v3.1, using the `@Schema` annotation's `nullable` property to generate standard-compliant type arrays in the specification.

0 commit comments

Comments
 (0)