Explorar el Código

Generate ErrorResponse struct from swagger spec.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Daniel Nephin hace 8 años
padre
commit
bc75738545
Se han modificado 4 ficheros con 151 adiciones y 138 borrados
  1. 132 131
      api/swagger.yaml
  2. 17 0
      api/types/error_response.go
  3. 0 6
      api/types/errors.go
  4. 2 1
      hack/generate-swagger-api.sh

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 132 - 131
api/swagger.yaml


+ 17 - 0
api/types/error_response.go

@@ -0,0 +1,17 @@
+package types
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+/*ErrorResponse Represents an error.
+
+swagger:model ErrorResponse
+*/
+type ErrorResponse struct {
+
+	/* The error message.
+
+	Required: true
+	*/
+	Message string `json:"message"`
+}

+ 0 - 6
api/types/errors.go

@@ -1,6 +0,0 @@
-package types
-
-// ErrorResponse is the response body of API errors.
-type ErrorResponse struct {
-	Message string `json:"message"`
-}

+ 2 - 1
hack/generate-swagger-api.sh

@@ -6,7 +6,8 @@ swagger generate model -f api/swagger.yaml \
     -n Volume \
     -n Port \
     -n ImageSummary \
-    -n Plugin -n PluginDevice -n PluginMount -n PluginEnv -n PluginInterfaceType
+    -n Plugin -n PluginDevice -n PluginMount -n PluginEnv -n PluginInterfaceType \
+    -n ErrorResponse
 
 swagger generate operation -f api/swagger.yaml \
     -t api -s server -a types -m types \

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio