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

Rest - Step 1 - support loop reference #453

Merged
merged 3 commits into from
Jul 4, 2016
Merged

Conversation

hellosnow
Copy link
Contributor

@hellosnow hellosnow commented Jul 1, 2016

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

@@ -116,7 +117,16 @@ public void ParseSwaggerJsonWithPathParametersShouldSucceed()
public void ParseSwaggerJsonWithLoopReferenceShouldFail()
Copy link
Contributor Author

@hellosnow hellosnow Jul 1, 2016

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

@superyyrrzz
Copy link
Contributor

👍

refStack.Push(referencedObject.Location);

// Clone to avoid change the reference object in _documentObjectCache
swagger.Reference = (SwaggerObject)ResolveReferences(referencedObject.Clone(), refStack);
Copy link
Contributor Author

@hellosnow hellosnow Jul 4, 2016

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

@taomylife521
Copy link

22222

@vwxyzh
Copy link
Contributor

vwxyzh commented Jul 4, 2016

👍

@@ -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)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two spaces?

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

Successfully merging this pull request may close these issues.

6 participants