stoplightio / spectral

A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v3.1, v3.0, and v2.0 as well as AsyncAPI v2.x.
https://stoplight.io/spectral
Apache License 2.0
2.37k stars 228 forks source link

OneOf property is failing during OAS Schema Validation #2556

Closed RPS044 closed 7 months ago

RPS044 commented 7 months ago

Hello Team,

Requesting you to please check this issue and help. Performing schema validation with oneOf, discriminator and mapping property in oas3.0.

Error:

{ "fault": { "faultstring": "OASValidation MAM-EXT-SpecValidation with resource "oas://openapi.yaml": failed with reason: "[ERROR - An error occurred during schema validation - com.google.common.util.concurrent.UncheckedExecutionException: java.lang.NullPointerException.: []]"", "detail": { "errorcode": "steps.oasvalidation.Failed" } } } yaml file looks like:

image

image

Json payload looks like:

--data '{ "billableHeader": { "sourceSystem": "UPSTREAM_APP", "sourceTransactionType": "INVOICE", "eventType": "BATCH", "messageCreationDatetime": "20220811140203", "timeZoneCode": "GMT", "isBulkProcessing": true, "product": "Airlcl" },

P0lip commented 7 months ago

Hello. This doesn't look like an error reported by Spectral. I'd recommend reaching out to the author of the tool you use as they are likely to be better positioned to assist you. Thank you for your understanding.