open-api-spex / open_api_spex

Open API Specifications for Elixir Plug applications
Mozilla Public License 2.0
681 stars 177 forks source link

Nullable and patern #595

Open ntnchrrn07 opened 4 months ago

ntnchrrn07 commented 4 months ago

Hi, I could not use for a string pattern and nullable, is it normal ?

OpenApiSpex.schema(%{
  title: "mySchema",
  type: :object,
  properties: %{
    dummy: %Schema{
      type: :string,
      nullable: true,
      pattern: "^[0-9]{3}$"
    }

}

I would like to allow :

{dummy: null} and {dummy: "010"}