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
I'm trying to use custom validators for specific types that require fine validations that OpenAPI doesn't support.
I came across the option x-validate, but when I try to use it I get a type error.
I'm defining my schemas in a YAML file and I think this option was designed with the module-based schema definition only.
10:45:27.528 [error] ** (ArgumentError) you attempted to apply a function on "MyApp.Spex.Validations.Regex". Modules (the first argument of apply) must always be an atom
(erts 15.1) :erlang.apply("MyApp.Spex.Validations.Regex", :cast, [%OpenApiSpex.Cast{value: "*", schema: %OpenApiSpex.Schema%{type: :string, description: "If the format is regex, this option must be set specifying the Ruby Regular Expression to be used to parse and compose the structured message.", title: "Regex", "x-validate": "MyApp.Spex.Validations.Regex"}
schema:
...
regex:
title: Regexdescription: this must be set specifying the Ruby Regular Expression to be used to parse.type: stringx-validate: MyApp.Spex.Validations.Regex
...
Hi,
I'm trying to use custom validators for specific types that require fine validations that OpenAPI doesn't support.
I came across the option
x-validate
, but when I try to use it I get a type error.I'm defining my schemas in a YAML file and I think this option was designed with the module-based schema definition only.
schema:
Issue found at: https://github.com/open-api-spex/open_api_spex/blob/v3.21.2/lib/open_api_spex/cast.ex#L122
The text was updated successfully, but these errors were encountered: