Azure / Azure/data-api-builder

[Bug]: OpenAPI and $filter for dates

Offen
#2,783 5 Kommentare 6 Reaktionen 3 zugewiesene Personen Beansprucht von @JerryNixon Auf GitHub ansehen
2.2 bug cri open-api triage
Vorherrschende Sprache
C#
Sterne
1.5k
Forks
370
Ø Merge
3 T. 22 Std.
Gemergte PRs (30 T.)
9

Beschreibung

### What happened?

Hi Team,

We've developed a custom frontend and backend solution to manage API creation on our API Management platform, utilizing Data API Builder (DAB) to select fields and apply dynamic and fixed filters to APIs.

The issue arises with certain MSSQL tables using the datetime(2) data type. In the OpenAPI specification generated by DAB, these columns are represented as string types without a specified format.

**OpenAPI exposed by DAB**
Image

For exposure through REST we don't have issues, but there's now a requirement to add filters based on those dates.
The data within the database looks like a normal date (not ISO8601 compliant) and is exposed through DAB rest endpoint as follows:

Image

According to the documentation, date values should not be enclosed in quotes. However, when dynamically constructing the $filter parameter for DAB, we currently lack a method to distinguish whether a field is a true string or a date field.

Image

One proposed solution was to omit quotes for non-eq comparisons, but this approach fails when an exact date match is required.

Any insights or suggestions to address this issue would be appreciated.

Best Regards,
Siebe

### Version

1.3.19

### What database are you using?

Azure SQL

### What hosting model are you using?

Container Apps

### Which API approach are you accessing DAB through?

REST

### Relevant log output

```Text

```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.