Using the GCP Endpoint (v2) library, we've defined our API as follows:
@method(UserAccountMessage, StatusMessage,
path='updateProfileAndAppSettings', http_method='POST')
def updateProfileAndAppSettings(self, request):
""" some user API
"""
We then generate a swagger/OpenAPI spec from this. We then use this
Swagger spec to generate a Swift 4 client.
Looking at the Swift client, I see that the UserAccountMessage is specified
as Optional (ie not required).
open class func userServiceUpdateProfileAndAppSettings(
body: ProtorpcMessagesComposedUserBioMessageUserAppSettingsMessage? = nil)
-> Promise<CommonMessagesMessageTypesStatusMessage>
So when encoding a message on the client, destined for the server, I'm
seeing things like this:
{ "FieldName": "Optional(2)"}
And the server is rejecting this payload before it ever even reaches our
code. I'm guessing the 400 error is happening in the endpoints front-end.
I need to know how to mark my inbound payload as "required/mandatory" and
in looking at the @method( signature, I'm not seeing any args to override
this behavior. Can someone please clarify for me?
--
You received this message because you are subscribed to the Google Groups
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.