profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/danieljacobs1/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Dan Jacobs danieljacobs1 BMLL Technologies London, UK

issue commentOAI/OpenAPI-Specification

Arbitrary query parameter names?

Thanks @hkosova.

... can be defined as a single parameter whose value is a dictionary ...

Unfortunately, I'm not at liberty to change the API at the moment. The tag names have to be the query string parameter names as this is an existing API with many clients.

The dictionary value would be a good approach going forward for new endpoints.

danieljacobs1

comment created time in 2 months

issue commentOAI/OpenAPI-Specification

Arbitrary query parameter names?

Thanks for the fast reply. I think I saw those earlier when I was searching around, but I wasn't sure.

It would be nice for confirmation, but I read https://github.com/OAI/OpenAPI-Specification/issues/1637 as if they have an endpoint that can produce the query parameter names and would it be possible to generate a UI dynamically from its response.

And https://github.com/OAI/OpenAPI-Specification/issues/1054 has the q as it's query parameter name and it feels a bit different.

For the case I'm asking about, I was imagining it might look like this:

openapi: 3.0.0
info:
  title: Service
  description: Endpoints
  version: 1.0.0
paths:
  /resources:
    get:
      parameters:
        - in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - inactive
        - in: query
          metaVarName: tagName  # Mutually exclusive with 'name'
            schema:
              type: string
              regexp: [_a-zA-Z][_a-zA-Z0-9]*
          metaVarValue: tagValue
            schema:
              type: string
              regexp: [_a-zA-Z][_a-zA-Z0-9]*
      responses:
        '200':
          description: "All resources successfully obtained."

and it could generate a UI that allowed adding of arbitrary numbers of name/value pairs for tags.

It might be possible that one solution in openapi solves all three of the problems, but I'm not qualified to say.

danieljacobs1

comment created time in 2 months