コード例 #1
0
		public ResourceType Build(IDictionary<string, object> dynamicRaml)
		{
			var resourceType = new ResourceType
			{
			    Get = getVerb(dynamicRaml, "get", VerbType.GET),
			    Post = getVerb(dynamicRaml, "post", VerbType.POST),
			    Put = getVerb(dynamicRaml, "put", VerbType.PUT),
			    Delete = getVerb(dynamicRaml, "delete", VerbType.DELETE),
			    Patch = getVerb(dynamicRaml, "patch", VerbType.PATCH),
			    Options = getVerb(dynamicRaml, "options", VerbType.OPTIONS)
			};

		    return resourceType;
		}
コード例 #2
0
        public ResourceType Build(IDictionary<string, object> dynamicRaml, string defaultMediaType)
        {
            var resourceType = new ResourceType
            {
                Type = TypeExtractor.Get(dynamicRaml),
                Is = TypeExtractor.GetIs(dynamicRaml),
                Get = GetVerb(dynamicRaml, "get", VerbType.GET, defaultMediaType),
                Post = GetVerb(dynamicRaml, "post", VerbType.POST, defaultMediaType),
                Put = GetVerb(dynamicRaml, "put", VerbType.PUT, defaultMediaType),
                Delete = GetVerb(dynamicRaml, "delete", VerbType.DELETE, defaultMediaType),
                Patch = GetVerb(dynamicRaml, "patch", VerbType.PATCH, defaultMediaType),
                Options = GetVerb(dynamicRaml, "options", VerbType.OPTIONS, defaultMediaType),
                Annotations = AnnotationsBuilder.GetAnnotations(dynamicRaml),
                UriParameters = ParametersBuilder.GetUriParameters(dynamicRaml, "uriParameters")
            };

            return resourceType;
        }