GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix for 700: changed ObjectSerializer to remove $id and $ref unless there is a circular ref by adamralph · Pull Request #920 · scriptcs/scriptcs

Conversation

@adamralph

@adamralph adamralph commented Feb 5, 2015

Copy link
Copy Markdown
Contributor

fixes #700

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
adamralph added 2 commits February 5, 2015 15:12
@adamralph
red: change ObjectSerializerTests to expect no $id and $ref unless th…
7e2983f
…ere is a circular ref
@adamralph
green: changed ObjectSerializer to remove $id and $ref unless there i…
1e48d7a
…s a circular ref
@adamralph adamralph added the child PR label Feb 5, 2015
glennblock
glennblock reviewed Feb 6, 2015
View reviewed changes
Comment thread test/ScriptCs.Hosting.Tests/ObjectSerializerTests.cs

@glennblock glennblock Feb 6, 2015

Copy link
Copy Markdown
Contributor

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.

Would be nice to change this test and ShouldSerializeDelegates to verify the result similar to what you did in ShouldSerialize. All it does now is verify that there is no exception, not that the result is correct ;-)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@glennblock

glennblock commented Feb 6, 2015

Copy link
Copy Markdown
Contributor

Overall LGTM, but I think we should improve the two tests I mentioned if we are in this code.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adamralph

adamralph commented Feb 6, 2015

Copy link
Copy Markdown
Contributor Author

Very good point. I'll add that shortly.
On 6 Feb 2015 07:42, "Glenn Block" [email protected] wrote:

Overall LGTM, but I think we should improve the two tests I mentioned if
we are in this code.

—
Reply to this email directly or view it on GitHub
#920 (comment).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adamralph

adamralph commented Feb 6, 2015

Copy link
Copy Markdown
Contributor Author

@glennblock the serialization of Type methods is enormous. Are we sure we want to do this? IIRC this test was added after I witnessed typeof(Type).GetMethods(); blow up on stage for Jon Skeet at NDC London and ensuring an exception wasn't thrown was it's specific purpose.

The serialization of the Action and Func is of a manageable size.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adamralph
refactor: change remaining ObjectSerializerTests to 3A's
b3130bd
@adamralph

adamralph commented Feb 6, 2015

Copy link
Copy Markdown
Contributor Author

Ugh... there's also a problem with asserting the Action and Func. The names of the hoisted methods are not deterministic. E.g. if I run just the single test method, the hoisted method is named <ShouldSerializeDelegates>b__3. If I run the entire test class, the hoisted method is named <ShouldSerializeDelegates>b__6.

I think we'll have to leave these tests as they are, but I've refactored them to 3A's, instead of using the Assert.Throws().

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adamralph

adamralph commented Feb 6, 2015

Copy link
Copy Markdown
Contributor Author

Ultimately, we're not trying to assert the serialization of all object types in this test class, but there are specific cases for which we originally had errors, i.e. the methods of Type and any Action or Func, so at least those tests are locking in the serialization of those types without errors.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@glennblock

glennblock commented Feb 7, 2015

Copy link
Copy Markdown
Contributor

OK, sounds good.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

glennblock added a commit that referenced this pull request Feb 7, 2015
@glennblock
Merge pull request #920 from adamralph/700
a319850
fix for 700: changed ObjectSerializer to remove $id and $ref unless there is a circular ref
@glennblock
glennblock merged commit a319850 into scriptcs:dev Feb 7, 2015
@adamralph
adamralph deleted the 700 branch February 7, 2015 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

child PR

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Remove redundant $id from JSON strings in REPL

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@adamralph @glennblock
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.