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

schema reference not expanded for request body #35

Open
databus23 opened this issue Jun 29, 2017 · 5 comments
Open

schema reference not expanded for request body #35

databus23 opened this issue Jun 29, 2017 · 5 comments

Comments

@databus23
Copy link

Trying to import this swagger definition https://gist.github.com/databus23/848f60539956284e504605d4d9c01bc1

I noticed that the JSF contains this:
image

@sirago
Copy link

sirago commented Sep 28, 2017

Same here. Update on this?

@JonathanMontane
Copy link
Contributor

@sirago @databus23 If you go in your environment, you'll see that all the swagger definitions are saved there. Unfortunately, there are currently limitations in Paw wrt. to what you can do with JSON objects and unfortunately expanding linked objects inside a JSON is not possible atm. I would love to be able to do something like this:

{
  "$ref": "#/definitions/Cluster",
  "definitions": {
    "Cluster": EnvironmentVariable<swagger_definitions.Cluster>
  }
}

But that does not handle the JSON object correctly 😢

The reason we don't directly expand the definitions is that they are shared across multiple requests/objects, and we'd lose this shared aspect by inserting the corresponding references inside the JSF DVs. This would make it extremely brittle in case of changes of the model, as this would basically mean that you'd have to change every single JSF field manually, which is extremely error-prone. I preferred to just have a link that says "here's where the schema is" rather than having a potentially stale schema that could induce bugs (especially since JSF is an rng generation lib, and those are hell to debug).

I know the solution isn't great, but if someday Paw has improved support for JSON objects, I'll update the library to make this awesome.

@mshahat
Copy link

mshahat commented Nov 17, 2017

Hi Jonathan, so picking up on this issue from the other thread too, you mentioned

I know the solution isn't great

which solution exactly ?

If is the tool is not supporting this essential situation, i'd like to know what would be a workflow to work with a swagger that's referencing json schema externally please ?

Many thanks,

@JonathanMontane
Copy link
Contributor

@mshahat Sorry if I was unclear, I was talking about the current implementation of the swagger schema storage inside of Paw, which isn't a great solution to the problem of linked swagger schemas, but the best currently available.

Otherwise, it's not possible at the moment to reference json schemas from within json schemas.

The only currently possible solution is to have no $ref in your schemas. If you don't have any then, you can store your json schemas inside environment variables as JSON Dynamic Values, and the references them from your request variables or body.

@rmatec
Copy link

rmatec commented Jun 27, 2018

Very unfortunate. This is a deal breaker for many developers. There is also an issue like this in Postman which made me evaluate Paw hoping it would work better but now we have to move to some other software.

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

5 participants