nextcloud / openapi-extractor

A tool for extracting OpenAPI specifications from Nextcloud source code
https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-openapi.html
GNU Affero General Public License v3.0
7 stars 2 forks source link

feat: Make boolean quirk an enum #45

Closed provokateurin closed 10 months ago

provokateurin commented 11 months ago

For query parameters we have to convert booleans into integers as they are only accepted that way. This sets the enum field on the returned integer schema to indicate that these are the only possible values. Can be tested in the server.

nickvergessen commented 10 months ago

Conflicting files src/OpenApiType.php

provokateurin commented 10 months ago

Fixed

provokateurin commented 10 months ago

The problem is that query parameters are always interpreted as true unless the value is 0. So we need to map them as integers :/

nickvergessen commented 10 months ago

Added tests in https://github.com/nextcloud/openapi-extractor/pull/59

nickvergessen commented 10 months ago

The problem is that query parameters are always interpreted as true unless the value is 0.

But not when you POST a JSON body, but it will work in both cases anyway, so okay

provokateurin commented 10 months ago

Yes with a json post body boolean works fine, but not with the query parameters as we use them here.