Opened 4 years ago

Last modified 5 months ago

#22034 new enhancement

[PATCH] Improve OpenAPI and remote control output — at Initial Version

Reported by: hiddewie Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: openapi swagger Cc: gaben

Description

I was using the remote control APIs and found the OpenAPI file lacking in details. Especially the types of parameters were all string which removes validation in the Swagger UI and other OpenAPI tools.

There was a TODO in the code for this.

To solve the issue of parameter typing, I added a RequestParameter class that handles the conversion and parsing from request parameters to the actual parameter value. It also contains the metadata like whether the parameter is required and the OpenAPI type.

Attached is the patch file.

Changes:

  • Add response codes & descriptions to each API
  • OpenAPI version from 3.0.0 to 3.0.3
  • Use the configured port in the OpenAPI server block from the configured property remote.control.port or the default (using IntegerProperty).
  • Add RequestParameter object that describes and parses a mandatory/optional request parameter. This information is used in the OpenAPI specification as well
  • Capitalize descriptions of the request handlers

The class RequestHandler should be backwards compatible for use in plugins.

Change History (2)

by hiddewie, 4 years ago

Attachment: remote-control.patch added

patch v1

by hiddewie, 4 years ago

Attachment: remote-control.2.patch added

patch v2

Note: See TracTickets for help on using tickets.