Skip to content

Incorrect enum type on Query.FilterType #66

Description

@damyanpetev

See `"#/components/schemas/FilterType" in https://data-northwind.indigo.design/swagger/v1/swagger.json
Currently outputs as:

  "FilterType": {
    "enum": [
      "And",
      "Or"
    ],
    "type": "string",
    "format": "int32"
  }

Note that the values as provided (words) do not agree with the format specified (int32) and will fail any form of validation and should technically also reject the 0 we're sending to that endpoint I believe, see below for more.

Possibly related to #63
Mind you, enums are technically not only strings by default and can take on just about any form it seems, including mixed - see https://json-schema.org/understanding-json-schema/reference/enum#extended-example:-accepting-multiple-data-types. Honestly, need to check the spec, as those make it seem like the type property is entirely irrelevant next to enum.
Note, I don't mind describing all enums on this API with their string representation - that's up to us and IIRC most .NET deserialization handles both value and name for options just fine. We might still need to respect some enums values as well.

// CC @zdrawku This is at least one of the issues that stem from the /QueryBuilder/ExecuteQuery and the model behind it we might need to adapt to.
There's a separate issue with this model accepting numeric values as well and it should likely describe itself as accepting both options since we do want to send numeric values directly from the Query Builder component itself too.

PS: Also, if we're manipulating the the generated OpenAPI output manually (I though OpenAPI is built-in at this point in ASP.NET so it it'd be pretty polished, but hey), might not be a bad idea to have tests validating it. There's a good chance the

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions