-
Notifications
You must be signed in to change notification settings - Fork 866
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
Rest - Step 1 - support loop reference #453
Conversation
@@ -116,7 +117,16 @@ public void ParseSwaggerJsonWithPathParametersShouldSucceed() | |||
public void ParseSwaggerJsonWithLoopReferenceShouldFail() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update case name to "ShouldSucceed" #Closed
👍 |
refStack.Push(referencedObject.Location); | ||
|
||
// Clone to avoid change the reference object in _documentObjectCache | ||
swagger.Reference = (SwaggerObject)ResolveReferences(referencedObject.Clone(), refStack); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deep clone would cause memory usage problem, need further investigation #Closed
22222 |
👍 |
@@ -45,7 +45,7 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s | |||
{ | |||
var swagger = (SwaggerObject)swaggerBase; | |||
var jObject = new JObject(); | |||
foreach (var i in swagger.Dictionary) | |||
foreach (var i in swagger.Dictionary.Where(p => !(p.Value is SwaggerLoopReferenceObject))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two spaces?
Rest - Step 1 - support loop reference, for example, A -> B -> A -> B, now the chain is A -> B.
Next step is to print "A" in the template, then B will point to string "A" just for indicating.
@herohua @vwxyzh @chenkennt @qinezh @superyyrrzz @ansyral