Skip to content

is it possible to return a generic JSON? (no schema in swagger) #88

@seralf

Description

@seralf

Hi
I'm trying to develop a component which exposes its own API as defined in the swagger model, but for a couple of endpoints has to call an external service, and expose directly the results from it, acting as a sort of proxy.

Is it that possible using the api-first-hand plugin?
I mean: I expected to be able to use a definition similar to the following one:

"/items": 
  
    get: 
      operationId: "listOfItems"
      produces: 
        - "application/json"
      responses: 
        200:
          schema:
            type: object

But it will produce a case class ItemsGetResponses200() "empty" (no fields).
Using AnyValue, object or {} object schema, I always get the same behaviour.

Is there maybe a default model I could use here?
I'm fine declaring models first, but for this case only I really can't: I have to put the data in the response as they were from the external service, and still declare at least the endpoint and its parameters for swagger.

Does anybody has any idea on how to accomplish that? tanks in advance

Alfredo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions