opened
tjprescott
username_0
Closes #97.

This works as intended, but the generated code has bugs, so we should discuss what the approach should be: a) workaround in code-gen or b) fix in Swagger.

```Swift
// Value of optional type must be unwrapped to refer to member 'foo'...
if let val = body.foo {
  patch.replace(atPath: "foo/", withValue: val)
}
```
The problem here is that for a PATCH, the body should not be optional since there's no point in a patch operation without a body.


```Swift
// Initializer for conditional binding must have Optional type
if let val = body.bar {
  patch.replace(atPath: "bar/", withValue: val)
}
```
Here the body isn't optional, but neither is the property `bar`. All properties on the patch object should be optional, since it is the optionality that determines whether an update is sent. Arguably, since this object only contains one property, it should be required, but that's very special case. The question is, should we work around that in the code generator?
Limited JSON Patch
issue
created
sacheu
username_1
Since `All properties on the patch object should be optional`, so even there is only 1 property, it should still be optionals. 

So we can make this object contains 1 property to be optionals and that resolve this issue? Am I missing something?
comment