From 1e22d1376ed9f7dbd00542a0e2f48955d76c356c Mon Sep 17 00:00:00 2001 From: Bob van Luijt Date: Wed, 26 Apr 2017 13:05:47 +0200 Subject: [PATCH] Add Swagger release v0.1.1. This closes #40 and closes #41 --- restapi/configure_weaviate.go | 2 +- restapi/embedded_spec.go | 3 ++- .../commands/weaviate_commands_insert_parameters.go | 10 +++++++--- .../commands/weaviate_commands_insert_urlbuilder.go | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/restapi/configure_weaviate.go b/restapi/configure_weaviate.go index 1104e1d482..1f0ddc57d1 100644 --- a/restapi/configure_weaviate.go +++ b/restapi/configure_weaviate.go @@ -11,7 +11,7 @@ * See package.json for author and maintainer info * Contact: @weaviate_iot / yourfriends@weaviate.com */ - package restapi +package restapi import ( "crypto/tls" diff --git a/restapi/embedded_spec.go b/restapi/embedded_spec.go index 371e54491d..5afba927b7 100644 --- a/restapi/embedded_spec.go +++ b/restapi/embedded_spec.go @@ -354,7 +354,8 @@ func init() { }, { "maximum": 25000, - "type": "string", + "type": "integer", + "format": "int64", "description": "Number of milliseconds to wait for device response before returning.", "name": "responseAwaitMs", "in": "query" diff --git a/restapi/operations/commands/weaviate_commands_insert_parameters.go b/restapi/operations/commands/weaviate_commands_insert_parameters.go index 60fa18634e..922bb531d4 100644 --- a/restapi/operations/commands/weaviate_commands_insert_parameters.go +++ b/restapi/operations/commands/weaviate_commands_insert_parameters.go @@ -95,7 +95,7 @@ type WeaviateCommandsInsertParams struct { Maximum: 25000 In: query */ - ResponseAwaitMs *string + ResponseAwaitMs *int64 /*IP address of the site where the request originates. Use this if you want to enforce per-user limits. In: query */ @@ -325,7 +325,11 @@ func (o *WeaviateCommandsInsertParams) bindResponseAwaitMs(rawData []string, has return nil } - o.ResponseAwaitMs = &raw + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("responseAwaitMs", "query", "int64", raw) + } + o.ResponseAwaitMs = &value if err := o.validateResponseAwaitMs(formats); err != nil { return err @@ -336,7 +340,7 @@ func (o *WeaviateCommandsInsertParams) bindResponseAwaitMs(rawData []string, has func (o *WeaviateCommandsInsertParams) validateResponseAwaitMs(formats strfmt.Registry) error { - if err := validate.Maximum("responseAwaitMs", "query", float64(*o.ResponseAwaitMs), 25000, false); err != nil { + if err := validate.MaximumInt("responseAwaitMs", "query", int64(*o.ResponseAwaitMs), 25000, false); err != nil { return err } diff --git a/restapi/operations/commands/weaviate_commands_insert_urlbuilder.go b/restapi/operations/commands/weaviate_commands_insert_urlbuilder.go index 2642ff15b6..b027b77c70 100644 --- a/restapi/operations/commands/weaviate_commands_insert_urlbuilder.go +++ b/restapi/operations/commands/weaviate_commands_insert_urlbuilder.go @@ -34,7 +34,7 @@ type WeaviateCommandsInsertURL struct { OauthToken *string PrettyPrint *bool QuotaUser *string - ResponseAwaitMs *string + ResponseAwaitMs *int64 UserIP *string _basePath string @@ -137,7 +137,7 @@ func (o *WeaviateCommandsInsertURL) Build() (*url.URL, error) { var responseAwaitMs string if o.ResponseAwaitMs != nil { - responseAwaitMs = *o.ResponseAwaitMs + responseAwaitMs = swag.FormatInt64(*o.ResponseAwaitMs) } if responseAwaitMs != "" { qs.Set("responseAwaitMs", responseAwaitMs)