cannot deserialize from Object value (Grallvm native executable)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Tái hiện tệp thực thi native phân tích books.yaml, sau đó lần theo lỗi từ OpenAPIParser.readLocation qua SwaggerConverter.convert đến quá trình giải tuần tự ArraySchema. So sánh kết quả native với parser Java thông thường và xác định cần những gì để parser native trả về các đối tượng OpenAPI đã được điền đầy đủ mà không gặp exception được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Using plain java graalvm native executables cause multiple issues. The parser mostly returns empty OpenAPI objects without any error. Only on one file I can receive an error. I tried to initialise swagger models at run time, but this did not help --initialize-at-run-time=io.swagger.v3.oas.models
It would be really cool to know how to use the swagger parser on plain native java.
[ERROR] Failed to parse OpenAPI file [books.yaml]: Cannot construct instance of `io.swagger.v3.oas.models.media.ArraySchema`: cannot deserialize from Object value (no delegate- or property-based Creator): this appears to be a native image, in which case you may need to configure reflection for the class that is to be deserialized
at [Source: UNKNOWN; byte offset: #UNKNOWN]
java.lang.IllegalArgumentException: Cannot construct instance of `io.swagger.v3.oas.models.media.ArraySchema`: cannot deserialize from Object value (no delegate- or property-based Creator): this appears to be a native image, in which case you may need to configure reflection for the class that is to be deserialized
at [Source: UNKNOWN; byte offset: #UNKNOWN]
at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:4618)
at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:4549)
at io.swagger.v3.parser.converter.SwaggerConverter.convert(SwaggerConverter.java:1188)
at io.swagger.v3.parser.converter.SwaggerConverter.convert(SwaggerConverter.java:865)
at io.swagger.v3.parser.converter.SwaggerConverter.convert(SwaggerConverter.java:635)
at io.swagger.v3.parser.converter.SwaggerConverter.convert(SwaggerConverter.java:531)
at io.swagger.v3.parser.converter.SwaggerConverter.convert(SwaggerConverter.java:250)
at io.swagger.v3.parser.converter.SwaggerConverter.readResult(SwaggerConverter.java:104)
at io.swagger.v3.parser.converter.SwaggerConverter.readLocation(SwaggerConverter.java:85)
at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:16)
at java.base@22/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:212)
at java.base@22/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:194)
at java.base@22/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:194)
at java.base@22/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:194)
at java.base@22/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:194)
at java.base@22/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:212)
at java.base@22/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base@22/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
at java.base@22/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:556)
at java.base@22/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:546)
at java.base@22/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.base@22/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.base@22/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
at java.base@22/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:611)
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `io.swagger.v3.oas.models.media.ArraySchema`: cannot deserialize from Object value (no delegate- or property-based Creator): this appears to be a native image, in which case you may need to configure reflection for the class that is to be deserialized
at [Source: UNKNOWN; byte offset: #UNKNOWN]
at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1887)
at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:414)
at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1370)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1505)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:348)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:185)
at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:4613)
swagger: "2.0"
info:
version: "1.0.0"
title: "Books API"
description: "API to manage books, authors, and their relationships."
termsOfService: "https://api.books.example.com/terms"
contact:
name: "API Support"
url: "https://api.books.example.com/support"
email: "[email protected]"
license:
name: "MIT"
url: "https://opensource.org/licenses/MIT"
host: "api.books.example.com"
basePath: "/v1"
schemes:
- https
tags:
- name: "Books"
description: "Operations related to books"
- name: "Authors"
description: "Operations related to authors"
- name: "Management"
description: "Administrative operations"
paths:
/books:
get:
tags:
- "Books"
summary: "Retrieve all books"
description: "Returns a list of all books available in the system."
responses:
200:
description: "A list of books"
schema:
type: "array"
items:
$ref: "#/definitions/Book"
post:
tags:
- "Books"
summary: "Add a new book"
description: "Adds a new book to the library."
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/Book"
responses:
201:
description: "Book created successfully"
/books/{id}:
get:
tags:
- "Books"
summary: "Retrieve a specific book"
description: "Fetch details of a book by its unique ID."
parameters:
- name: "id"
in: "path"
required: true
type: "string"
responses:
200:
description: "Book details retrieved"
schema:
$ref: "#/definitions/Book"
404:
description: "Book not found"
put:
tags:
- "Books"
summary: "Update a book"
description: "Updates information for a specific book."
parameters:
- name: "id"
in: "path"
required: true
type: "string"
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/Book"
responses:
200:
description: "Book updated successfully"
delete:
tags:
- "Books"
summary: "Delete a book"
description: "Deletes a specific book by its ID."
parameters:
- name: "id"
in: "path"
required: true
type: "string"
responses:
204:
description: "Book deleted successfully"
/authors:
get:
tags:
- "Authors"
summary: "Retrieve all authors"
description: "Fetch a list of all authors."
responses:
200:
description: "A list of authors"
schema:
type: "array"
items:
$ref: "#/definitions/Author"
post:
tags:
- "Authors"
summary: "Add a new author"
description: "Adds a new author to the system."
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/Author"
responses:
201:
description: "Author added successfully"
definitions:
Book:
type: "object"
required:
- id
- title
properties:
id:
type: "string"
title:
type: "string"
author:
type: "string"
publishedDate:
type: "string"
format: "date"
genre:
type: "string"
description: "Genre of the book"
Author:
type: "object"
required:
- id
- name
properties:
id:
type: "string"
name:
type: "string"
biography:
type: "string"
description: "A brief biography of the author"
birthDate:
type: "string"
format: "date"
description: "Author's date of birth"
securityDefinitions:
api_key:
type: "apiKey"
name: "X-API-KEY"
in: "header"
externalDocs:
description: "Find more info here"
url: "https://api.books.example.com/docs"
- Ngôn ngữ chính
- Java
- Star
- 868
- Fork
- 560
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của swagger-api/swagger-parser
-
InlineModelResolver.uniqueName throws StringIndexOutOfBoundsException for titles starting with a separator (camelCaseFlattenNaming)Có thể đã có người làm @arimu1 đã nhận 40 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
swagger-api/swagger-parser#2386 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
swagger-api/swagger-parser#2168 ·
-
ResolveFully fails on internal references when the initial spec is read from a file URLCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
swagger-api/swagger-parser#1922 · 2 bình luận · 1 reaction ·
-
[Bug]: `ResolverFully` does not process OAS 3.1 combinators and skips nested OAS 3.1 schema-valued keywordsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởBug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
swagger-api/swagger-parser#2403 ·
-
[Bug]: Regression: resolveFully fails when components key does not match external file basenameCó thể đã có người làm @goutamadwant đã nhận 34 ngày trước. Đang mởBug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
swagger-api/swagger-parser#2399 · 3 bình luận ·
Tất cả issue của swagger-api/swagger-parser
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
waiting-for-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
spring-cloud/spring-cloud-openfeign#1443 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
ADORSYS-GIS/keycloak-oid4vp-plugin#221 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Upgrade to Spring Pulsar 2.0.8Đang mởstatus: team-only type: dependency-upgrade
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
spring-projects/spring-boot#52099 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
tchiotludo/akhq#3307 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày