You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
The Helidon MP generators incorrectly add a @Pattern annotation to a property of type byte[] whereas @Pattern only applies to String.
This causes runtime errors.
openapi-generator version
7.7.0
OpenAPI declaration file content or url
openapi: 3.0.0servers:
- url: 'http://format.helidon.io:8080/format'info:
description: >- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. For this sample, you can use the api key `special-key` to test the authorization filters. Special characters: " \version: 1.0.0title: OpenAPI Formatterlicense:
name: Apache-2.0url: 'https://www.apache.org/licenses/LICENSE-2.0.html'tags:
- name: formatdescription: Format testerpaths:
/format:
get:
operationId: simpleresponses:
"200":
content: {}description: successtags:
- formatcomponents:
schemas:
format_test:
properties:
byte:
format: bytepattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"type: string
Generation Details
Here is the generation set-up in the project's automated sample generation format for Helidon v3:
Add the two above configuration yaml files as bin/configs/java-helidon-server-mp-X_format_test.yaml where the X in the middle is 3 for the first yaml file and 4 for the second.
Run ./bin/generate-samples.sh ./bin/configs/java-helidon-server-mp_3_format_test.yaml ./bin/configs/java-helidon-server-mp_4_format_test.yaml.
cat samples/server/others/java-helidon-server/v3/mp-format-test/src/main/java/org/openapitools/server/model/FormatTest.java and see the @Pattern annotation on getByte().
Bug Report Checklist
Description
The Helidon MP generators incorrectly add a
@Pattern
annotation to a property of typebyte[]
whereas@Pattern
only applies toString
.This causes runtime errors.
openapi-generator version
7.7.0
OpenAPI declaration file content or url
Generation Details
Here is the generation set-up in the project's automated sample generation format for Helidon v3:
And for Helidon v4:
Steps to reproduce
bin/configs/java-helidon-server-mp-X_format_test.yaml
where theX
in the middle is 3 for the first yaml file and 4 for the second../bin/generate-samples.sh ./bin/configs/java-helidon-server-mp_3_format_test.yaml ./bin/configs/java-helidon-server-mp_4_format_test.yaml
.cat samples/server/others/java-helidon-server/v3/mp-format-test/src/main/java/org/openapitools/server/model/FormatTest.java
and see the@Pattern
annotation ongetByte()
.v4
instead ofv3
.Related issues/PRs
See also #7153
Suggest a fix
Same fix as in the referenced PR.
The text was updated successfully, but these errors were encountered: