Skip to content
Merged
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 @@ -2,27 +2,13 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

using AutoRest.Core.Logging;
using AutoRest.Core.Validation;
using AutoRest.Swagger.Model;
using System.Collections.Generic;

namespace AutoRest.Swagger.Validation
{
public abstract class MutabilityExtensionRule : ExtensionRule
{
protected override string ExtensionName => "x-ms-mutability";

protected static Schema Get200ResponseSchema(RuleContext context)
{
OperationResponse response = context?.GetFirstAncestor<Operation>()?.Responses?.GetValueOrNull("200");
if (response == null)
{
return null;
}
var resolver = new SchemaResolver(context?.GetServiceDefinition());
return resolver.Unwrap(response.Schema);
}

public abstract override string MessageTemplate { get; }

/// <summary>
Expand Down