public void ShouldExcludePrimitiveTypesFromApiDeclarationModels()
        {
            // Arrange
            provider.RouteDataAccessor = new[]
            {
                new SwaggerRouteData {
                    ResourcePath = "/test", OperationModel = typeof(string)
                }
            };

            // Act
            var declaration = converter.GetApiDeclaration("/test");

            // Assert
            declaration.Models.Count.ShouldEqual(0);
        }
Ejemplo n.º 2
0
        public SwaggerModule(ISwaggerMetadataConverter converter)
            : base(SwaggerConfig.ResourceListingPath)
        {
            Get["/"] = _ => converter.GetResourceListing().ToJson();

            Get["/{resourcePath*}"] = _ => converter.GetApiDeclaration("/" + _.resourcePath).ToJson();
        }