From dcfe72a4caab3a61c40c37294045ba2d3d72f188 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Fri, 25 Jul 2014 14:50:07 -0700 Subject: [PATCH] renamed license type to license name #59 --- examples/mads/petstore-expanded.json | 2 +- examples/mads/petstore-simple.json | 2 +- examples/wordnik/petstore.json | 10 +++++++++- samples/v2.0/json/resources/commonParameters.json | 2 +- .../v2.0/json/resources/stringPathParamResource.json | 2 +- .../v2.0/json/resources/vendorExtensionExamples.json | 2 +- schemas/v2.0/schema.json | 8 ++++---- src/test/scala/TestBase.scala | 4 ++-- 8 files changed, 20 insertions(+), 12 deletions(-) diff --git a/examples/mads/petstore-expanded.json b/examples/mads/petstore-expanded.json index 44730c279e..b6b133b6e9 100644 --- a/examples/mads/petstore-expanded.json +++ b/examples/mads/petstore-expanded.json @@ -11,7 +11,7 @@ "url": "http://madskristensen.net" }, "license": { - "type": "MIT", + "name": "MIT", "url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT" } }, diff --git a/examples/mads/petstore-simple.json b/examples/mads/petstore-simple.json index 172f44464d..a8cca629b0 100644 --- a/examples/mads/petstore-simple.json +++ b/examples/mads/petstore-simple.json @@ -9,7 +9,7 @@ "name": "Wordnik API Team" }, "license": { - "type": "MIT" + "name": "MIT" } }, "host": "http://petstore.swagger.wordnik.com/api", diff --git a/examples/wordnik/petstore.json b/examples/wordnik/petstore.json index b8b432998e..50c41fca7d 100644 --- a/examples/wordnik/petstore.json +++ b/examples/wordnik/petstore.json @@ -2,7 +2,15 @@ "swagger": 2.0, "info": { "version": "1.0.0", - "title": "Swagger Petstore" + "title": "Swagger Petstore", + "contact": { + "name": "wordnik api team", + "url": "http://developer.wordnik.com" + }, + "license": { + "name": "Creative Commons 4.0 International", + "url": "http://creativecommons.org/licenses/by/4.0/" + } }, "host": "http://petstore.swagger.wordnik.com", "basePath": "/api", diff --git a/samples/v2.0/json/resources/commonParameters.json b/samples/v2.0/json/resources/commonParameters.json index 0fdbc44d63..2e45a879fb 100644 --- a/samples/v2.0/json/resources/commonParameters.json +++ b/samples/v2.0/json/resources/commonParameters.json @@ -10,7 +10,7 @@ "url": "http://developer.wordnik.com" }, "license": { - "type": "Creative Commons 4.0 International", + "name": "Creative Commons 4.0 International", "url": "http://creativecommons.org/licenses/by/4.0/" } }, diff --git a/samples/v2.0/json/resources/stringPathParamResource.json b/samples/v2.0/json/resources/stringPathParamResource.json index c374efb846..ede1ed18e5 100644 --- a/samples/v2.0/json/resources/stringPathParamResource.json +++ b/samples/v2.0/json/resources/stringPathParamResource.json @@ -10,7 +10,7 @@ "url": "http://developer.wordnik.com" }, "license": { - "type": "Creative Commons 4.0 International", + "name": "Creative Commons 4.0 International", "url": "http://creativecommons.org/licenses/by/4.0/" } }, diff --git a/samples/v2.0/json/resources/vendorExtensionExamples.json b/samples/v2.0/json/resources/vendorExtensionExamples.json index e3e9ed9d0e..d6cd21b5f0 100644 --- a/samples/v2.0/json/resources/vendorExtensionExamples.json +++ b/samples/v2.0/json/resources/vendorExtensionExamples.json @@ -14,7 +14,7 @@ "url": "http://developer.wordnik.com" }, "license": { - "type": "Creative Commons 4.0 International", + "name": "Creative Commons 4.0 International", "url": "http://creativecommons.org/licenses/by/4.0/" } }, diff --git a/schemas/v2.0/schema.json b/schemas/v2.0/schema.json index b0a506f3ce..4cd7e92a88 100644 --- a/schemas/v2.0/schema.json +++ b/schemas/v2.0/schema.json @@ -9,7 +9,7 @@ "info": { "type": "object", "description": "General information about the API.", - "required": [ "version", "title" ], + "required": [ "version", "title", "contact", "license" ], "additionalProperties": false, "patternProperties": { "^x-": { @@ -57,12 +57,12 @@ }, "license": { "type": "object", - "required": [ "type" ], + "required": [ "name" ], "additionalProperties": false, "properties": { - "type": { + "name": { "type": "string", - "description": "The name of the type of license. It's encouraged to use an OSI compatible license." + "description": "The name of the license type. It's encouraged to use an OSI compatible license." }, "url": { "type": "string", diff --git a/src/test/scala/TestBase.scala b/src/test/scala/TestBase.scala index 5af09be90c..bbb4d2195b 100644 --- a/src/test/scala/TestBase.scala +++ b/src/test/scala/TestBase.scala @@ -8,8 +8,8 @@ import scala.io.Source **/ trait TestBase { val mapper = new ObjectMapper - val host = "https://raw.githubusercontent.com/reverb/swagger-spec/master/schemas/v2.0/schema.json" - // val host = "http://localhost:8000/schema.json" + // val host = "https://raw.githubusercontent.com/reverb/swagger-spec/master/schemas/v2.0/schema.json" + val host = "http://localhost:8000/schema.json" def readSchema(makeQualified: Boolean = true) = { val json = Source.fromFile("schemas/v2.0/schema.json").getLines