Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
seralf opened this issue Sep 17, 2017 · 0 comments
Open

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

seralf opened this issue Sep 17, 2017 · 0 comments

Comments

@seralf
Copy link

seralf commented Sep 17, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant