Skip to content
This repository has been archived by the owner on Mar 21, 2019. It is now read-only.

Selectively show nullable DataMembers as optional #61

Open
makotogitdev opened this issue Jun 25, 2014 · 3 comments
Open

Selectively show nullable DataMembers as optional #61

makotogitdev opened this issue Jun 25, 2014 · 3 comments

Comments

@makotogitdev
Copy link
Collaborator

By default Swaggeratr show nullable DataMembers as optional. This is kind of strange particularly in a read response contract.

@superstator
Copy link
Owner

What would a mandatory nullable parameter look like? Not that I'm opposed to an option to override that default, I'm just having trouble picturing the use case.

@makotogitdev
Copy link
Collaborator Author

I was just thinking it would be nice to be able to remove the "optional" text in data type description of a parameter within a contract. But I guess "optional" text can just imply that it is possible that the parameter can be null for read responses.

@superstator
Copy link
Owner

Yeah, I think given we're talking about JSON/XML datacontracts, "optional" should be read as "nullable" most of the time. Especially given part of the value with Swagger is the ability to generate code from those contracts. Imagine generating code according to a Swagger spec, expecting that a given value in a response is required and will always be present - if it's actually nullable, eventually a JSON response may leave it out, and that code might fail.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants