Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<Content Include="Resource\Swagger\new\operation_check_04.json" />
<Content Include="Resource\Swagger\new\operation_check_05.json" />
<Content Include="Resource\Swagger\new\param_check_01.json" />
<Content Include="Resource\Swagger\new\removed_definition.json" />
<Content Include="Resource\Swagger\new\response_check_01.json" />
<Content Include="Resource\Swagger\new\version_check_01.json" />
<Content Include="Resource\Swagger\new\version_check_02.json" />
Expand All @@ -36,6 +37,7 @@
<Content Include="Resource\Swagger\new\version_check_02.json" />
<Content Include="Resource\Swagger\new\version_check_03.json" />
<Content Include="Resource\Swagger\new\version_check_04.json" />
<Content Include="Resource\Swagger\old\removed_definition.json" />
<Content Include="Resource\Swagger\old\misc_checks_01.json" />
<Content Include="Resource\Swagger\old\misc_checks_02.json" />
<Content Include="Resource\Swagger\old\operation_check_01.json" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"swagger": 2.0,
"info": {
"title": "removed_definition",
"version": "1.0"
},
"host": "localhost:8000",
"schemes": [ "http", "https" ],
"consumes": [ "text/plain", "text/json" ],
"produces": [ "text/plain" ],
"paths": {
"/api/Parameters": {
"put": {
"tag": [ "Parameters" ],
"operationId": "Parameters_Put",
"produces": [
"text/plain"
],
"parameters": [
{
"name": "database",
"in": "body",
"required": true,
"type": "object",
"schema": { "$ref": "#/definitions/Database" }
}
]
}
}
},
"definitions": {
"Database": {
"properties": {
"a": {
"type": "string",
"readOnly": true,
"description": "This is a system generated property.\nThe _rid value is empty for this operation."
},
"b": {
"type": "integer",
"readOnly": true,
"default": 0,
"description": "This property shows the number of databases returned."
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"swagger": 2.0,
"info": {
"title": "removed_definition",
"version": "1.0"
},
"host": "localhost:8000",
"schemes": [ "http", "https" ],
"consumes": [ "text/plain", "text/json" ],
"produces": [ "text/plain" ],
"paths": {
"/api/Parameters": {
"put": {
"tag": [ "Parameters" ],
"operationId": "Parameters_Put",
"produces": [
"text/plain"
],
"parameters": [
{
"name": "database",
"in": "body",
"required": true,
"type": "object",
"schema": { "$ref": "#/definitions/DatabaseList" }
}
]
}
}
},
"definitions": {
"DatabaseList": {
"properties": {
"a": {
"type": "string",
"readOnly": true,
"description": "This is a system generated property.\nThe _rid value is empty for this operation."
},
"b": {
"type": "integer",
"readOnly": true,
"default": 0,
"description": "This property shows the number of databases returned."
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void ResponseFormatAdded()
[Fact]
public void DefinitionRemoved()
{
var messages = CompareSwagger("misc_checks_01.json").ToArray();
var messages = CompareSwagger("removed_definition.json").ToArray();
var missing = messages.Where(m => m.Id == ComparisonMessages.RemovedDefinition.Id);
Assert.NotEmpty(missing);
Assert.Equal(Category.Error, missing.First().Severity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ public static class ComparisonMessages
Message = "The new version has a new required property '{0}' not found in the old version."
};

public static MessageTemplate RemovedDefinition = new MessageTemplate {
Id = 1006,
Message = "The new version is missing a definition that was found in the old version. Was '{0}' removed or renamed?"
};

public static MessageTemplate VersionsReversed = new MessageTemplate { Id = 1000, Message = "The new version has a lower value than the old: {0} -> {1}" };

public static MessageTemplate NoVersionChange = new MessageTemplate { Id = 1001, Message = "The versions have not changed." };
Expand All @@ -24,8 +29,6 @@ public static class ComparisonMessages

public static MessageTemplate RemovedPath = new MessageTemplate { Id = 1005, Message = "The new version is missing a path that was found in the old version. Was '{0}' removed or restructured?" };

public static MessageTemplate RemovedDefinition = new MessageTemplate { Id = 1006, Message = "The new version is missing a definition that was found in the old version. Was '{0}' removed or renamed?" };

public static MessageTemplate RemovedClientParameter = new MessageTemplate { Id = 1007, Message = "The new version is missing a client parameter that was found in the old version. Was '{0}' removed or renamed?" };

public static MessageTemplate ModifiedOperationId = new MessageTemplate { Id = 1008, Message = "The operation id has been changed from '{0}' to '{1}'. This will impact generated code." };
Expand Down