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

specs-go/v1/descriptor: Drop 'omitempty' from mediaType #553

Conversation

wking
Copy link
Contributor

@wking wking commented Feb 3, 2017

This is a required property, so omitempty serves no purpose.

@wking wking mentioned this pull request Feb 3, 2017
This is a required property, so 'omitempty' serves no purpose.

Signed-off-by: W. Trevor King <wking@tremily.us>
@wking wking force-pushed the drop-descriptor-media-type-omitempty branch from d9ae12f to 35b2972 Compare February 3, 2017 05:30
@philips
Copy link
Contributor

philips commented Feb 3, 2017

LGTM

Approved with PullApprove

@stevvooe
Copy link
Contributor

stevvooe commented Feb 3, 2017

omitempty has no bearing on whether the field is required or not. They are completely unrelated. It just means that if there is an empty string, you don't emit the field. Either way, the descriptor is still invalid.

I am in favor of leaving omitempty in place for all fields.

@wking
Copy link
Contributor Author

wking commented Feb 3, 2017 via email

@stevvooe
Copy link
Contributor

stevvooe commented Feb 3, 2017

@wking Look, I am just trying to reduce churn in areas that don't need changes. How bout someone tries to tackle action problems?

#467
#415

This doesn't even address a real problem. Is there a bug? Did this break something? No, it is just a waste of time.

For example, Descriptor.Size may be zero (and it's not omitempty [1]).

What exactly is the point of a zero-sized target object? In fact, there can only be one valid item with zero-sized target and that Digest is sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. What, then, is the media type of said thing?

Let's get focused on a 1.0 and stop faffing about.

@wking
Copy link
Contributor Author

wking commented Feb 4, 2017 via email

@stevvooe
Copy link
Contributor

stevvooe commented Feb 4, 2017

This is minor polishing to reduce confusion like [1] and save
maintainers time in the long run (by not having to field PRs like
#547).

How is this the cause of #547? The problem with #547 exists between a keyboard and a chair.

I didn't expect this removal to be so contentious ;).

It is just unnecessary.

@wking
Copy link
Contributor Author

wking commented Feb 4, 2017 via email

@stevvooe
Copy link
Contributor

stevvooe commented Feb 6, 2017

@wking Unfortunately, had I seen #410, I would have rejected it.

omitempty ensures that we have clean output that reduces errors in consumers. omitempty has nothing to do with REQUIRED vs OPTIONAL. Stop making that false equivalence.

I am closing this and I hope someone will take the time to revert #410 so I don't have to.

@stevvooe stevvooe closed this Feb 6, 2017
@wking wking mentioned this pull request Feb 6, 2017
wking added a commit to wking/image-spec that referenced this pull request Feb 16, 2017
From 0556a6b (image-layout: ./refs/ -> index.json, 2017-01-26, opencontainers#553).

Signed-off-by: W. Trevor King <wking@tremily.us>
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.

3 participants