Exemple #1
0
 public DemoMetadataModule(ISwaggerModelCatalog modelCatalog, ISwaggerTagCatalog tagCatalog) : base(modelCatalog, tagCatalog)
 {
     RouteDescriber.DescribeRoute("Demo", string.Empty, string.Empty, new []
     {
         new HttpResponseMetadata {
             Code = 200, Message = "OK"
         },
     }, null);
 }
Exemple #2
0
        public StatisticsMetadataModule(ISwaggerModelCatalog modelCatalog, ISwaggerTagCatalog tagCatalog)
            : base(modelCatalog, tagCatalog)
        {
            SwaggerTypeMapping.AddTypeMapping(typeof(DateTime), typeof(DateTime));

            RouteDescriber.AddBaseTag(new Tag
            {
                Description = "Operations for getting projection statistics",
                Name        = "Statistics"
            });

            RouteDescriber.DescribeRoute <IEnumerable <ProjectorSummary> >("GetAll", "",
                                                                           "Returns a list of all known projectors and a summary of their status", new[]
            {
                new HttpResponseMetadata {
                    Code = 200, Message = "OK"
                }
            });

            RouteDescriber
            .DescribeRoute <ProjectorDetails>("GetSpecific", "", "Returns the details of a specific projector", new[]
            {
                new HttpResponseMetadata {
                    Code = 200, Message = "OK"
                }
            })
            .Parameter(p => p.Name("id").In(ParameterIn.Path).Description("Identifies the projector"));


            RouteDescriber
            .DescribeRoute <ProjectorEventCollection>("GetEvents", "", "Returns the events logged for a specific projector", new[]
            {
                new HttpResponseMetadata {
                    Code = 200, Message = "OK"
                }
            })
            .Parameter(p => p.Name("id").In(ParameterIn.Path).Description("Identifies the projector"));;

            RouteDescriber
            .DescribeRoute <string>("GetEta", "", "Returns the ETA for a specific projector to reach a certain checkpoint", new[]
            {
                new HttpResponseMetadata {
                    Code = 200, Message = "OK"
                }
            })
            .Parameter(p => p.Name("id").In(ParameterIn.Path).Description("Identifies the projector"))
            .Parameter(p => p.Name("targetCheckpoint").In(ParameterIn.Path).Description("The target checkpoint for which to calculate the ETA"));

            RouteDescriber.AddAdditionalModels(
                typeof(ProjectorEvent), typeof(ProjectorProperty), typeof(ProjectorSummary));
        }
        public UsersMetadataModule(ISwaggerModelCatalog modelCatalog, ISwaggerTagCatalog tagCatalog)
            : base(modelCatalog, tagCatalog)
        {
            ModelCatalog.AddModels(typeof(PermissionAction));
            ModelCatalog.AddModels(typeof(PermissionRoleApiModel));
            ModelCatalog.AddModels(typeof(ResolvedPermissionApiModel));
            ModelCatalog.AddModels(typeof(UserApiModel));
            ModelCatalog.AddModels(typeof(List <RoleApiModel>));
            ModelCatalog.AddModels(typeof(PermissionRequestContext));

            RouteDescriber.DescribeRouteWithParams(
                "AddUser",
                "",
                "Adds a new user.",
                new []
            {
                new HttpResponseMetadata <UserApiModel>
                {
                    Code    = (int)HttpStatusCode.Created,
                    Message = "Created"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "User does not have access"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.BadRequest,
                    Message = "User object in body failed validation"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.Conflict,
                    Message = "User with specified IdentityProvider and Subject already exists"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.UnsupportedMediaType,
                    Message = "Content-Type header was not included in request"
                }
            },
                new[]
            {
                new BodyParameter <UserApiModel>(modelCatalog)
                {
                    Name        = "User",
                    Description = "The user to add"
                }
            },
                new []
            {
                _usersTag
            }).SecurityRequirement(OAuth2WriteScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "AddRolesToUser",
                "",
                "Adds roles to an existing user.",
                new[]
            {
                new HttpResponseMetadata <UserApiModel>
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "Roles added."
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "User does not have access to add the specified roles."
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.BadRequest,
                    Message = "List of roles in body failed validation"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.NotFound,
                    Message = "Specified user does not exist"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.UnsupportedMediaType,
                    Message = "Content-Type header was not included in request"
                }
            },
                new[]
            {
                new BodyParameter <List <RoleApiModel> >(modelCatalog)
                {
                    Name        = "Roles",
                    Description = "The roles to add"
                }
            },
                new[]
            {
                _usersTag
            }).SecurityRequirement(OAuth2WriteScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "DeleteRolesFromUser",
                "",
                "Deletes roles from existing user.",
                new[]
            {
                new HttpResponseMetadata <UserApiModel>
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "Roles deleted."
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "User does not have access to add the specified roles."
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.BadRequest,
                    Message = "List of roles in body failed validation"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.NotFound,
                    Message = "Specified user does not exist"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.UnsupportedMediaType,
                    Message = "Content-Type header was not included in request"
                }
            },
                new[]
            {
                new BodyParameter <List <RoleApiModel> >(modelCatalog)
                {
                    Name        = "Roles",
                    Description = "The roles to delete."
                }
            },
                new[]
            {
                _usersTag
            }).SecurityRequirement(OAuth2WriteScopeBuilder);

            RouteDescriber.DescribeRoute(
                "GetCurrentUserPermissions",
                "",
                "Gets permissions for currently authenticated user",
                new[]
            {
                new HttpResponseMetadata <UserPermissionsApiModel> {
                    Code = (int)HttpStatusCode.OK, Message = "OK"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                }
            },
                new[]
            {
                _usersTag
            }).SecurityRequirement(OAuth2ReadScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "GetUserPermissions",
                "",
                "Gets permissions for specified user. Note this will only retrieve 1) granular permissions and 2) permissions under roles mapped to Custom groups.",
                new[]
            {
                new HttpResponseMetadata <List <ResolvedPermissionApiModel> > {
                    Code = (int)HttpStatusCode.OK, Message = "OK"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                }
            },
                new[]
            {
                _identityProviderParameter,
                _subjectIdParameter
            },
                new[]
            {
                _usersTag
            }).SecurityRequirement(OAuth2ReadScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "AddGranularPermissions",
                "",
                "Adds granular permissions for a user, either to allow or deny",
                new[]
            {
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.NoContent,
                    Message = "Granular permissions were added"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.BadRequest,
                    Message = "No permissions to add included in request."
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Conflict,
                    Message = "The permissions specified already exist either as duplicates or with a different permission action than the one specified or a permission is in the request as both allow and deny"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.UnsupportedMediaType,
                    Message = "Content-Type header was not included in request"
                }
            },
                new[]
            {
                _identityProviderParameter,
                _subjectIdParameter,
                new BodyParameter <List <PermissionApiModel> >(modelCatalog)
                {
                    Name        = "GranularPermissions",
                    Description = "The permissions to add for the user."
                }
            },
                new[]
            {
                _usersTag
            }).SecurityRequirement(OAuth2ManageClientsScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "DeleteGranularPermissions",
                "",
                "Deletes granular permissions for a user",
                new[]
            {
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.NoContent,
                    Message = "The permissions were deleted"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.BadRequest,
                    Message = "No permissions were specified or the permissions specified do not exist or already exist with a different permission action."
                }
            },
                new[]
            {
                _identityProviderParameter,
                _subjectIdParameter,
                new BodyParameter <List <PermissionApiModel> >(modelCatalog)
                {
                    Name        = "GranularPermissions",
                    Description = "The permissions to delete from the user."
                }
            },
                new[]
            {
                _usersTag
            }).SecurityRequirement(OAuth2ManageClientsScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "GetUserGroups",
                "",
                "Gets custom groups for a user",
                new[]
            {
                new HttpResponseMetadata <IEnumerable <GroupUserApiModel> >
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "List of GroupUserApiModel entities representing groups in which the user belongs"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.NotFound,
                    Message = "User was not found"
                }
            },
                new[]
            {
                _subjectIdParameter
            },
                new[]
            {
                _usersTag
            }).SecurityRequirement(OAuth2ReadScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "GetUserRoles",
                "",
                "Gets the roles associated with a user",
                new[]
            {
                new HttpResponseMetadata <List <RoleApiModel> >
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "List of roles representing the roles this user has been directly associated to."
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.NotFound,
                    Message = "User was not found"
                }
            },
                new[]
            {
                _identityProviderParameter,
                _subjectIdParameter
            },
                new[]
            {
                _usersTag
            }).SecurityRequirement(OAuth2ReadScopeBuilder);
        }
Exemple #4
0
        public ServiceDetailsMetadataModule(ISwaggerModelCatalog modelCatalog, ISwaggerTagCatalog tagCatalog) : base(modelCatalog, tagCatalog)
        {
            RouteDescriber.AddBaseTag(new Tag()
            {
                Description = "Operations for handling the service",
                Name        = "Service"
            });

            var customerSubTag = new Tag()
            {
                Name        = "Service/Customers",
                Description = "Operations of 'Service' relating to Customers"
            };

            RouteDescriber.DescribeRoute("ServiceHome", "", "Get Home", new[]
            {
                new HttpResponseMetadata {
                    Code = 200, Message = "OK"
                }
            });

            RouteDescriber.AddAdditionalModels(typeof(ServiceOwner), typeof(ServiceCustomer));
            RouteDescriber.DescribeRoute <ServiceDetails>("GetDetails", "", "Get Details", new[]
            {
                new HttpResponseMetadata {
                    Code = 200, Message = "OK"
                }
            });

            RouteDescriber.DescribeRoute <IEnumerable <ServiceCustomer> >("GetCustomers", "", "Get Customers", new[]
            {
                new HttpResponseMetadata {
                    Code = 200, Message = "OK"
                }
            }, new[]
            {
                customerSubTag
            });

            RouteDescriber.DescribeRouteWithParams("GetCustomer", "", "Get Customer", new HttpResponseMetadata[]
            {
                new HttpResponseMetadata <ServiceCustomer> {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata <IEnumerable <ServiceCustomer> > {
                    Code = 202, Message = "Multiple Customers Found"
                },
                new HttpResponseMetadata {
                    Code = 404, Message = "No Customers Found"
                },
            }, new[]
            {
                new Parameter {
                    Name = "name", In = ParameterIn.Path, Required = true, Description = "The customer's name", Default = "Jack", Type = "string"
                }
            }, new[]
            {
                customerSubTag
            });

            RouteDescriber.DescribeRouteWithParams <ServiceCustomer>("PostNewCustomer", "", "Add a new customer", new[]
            {
                new HttpResponseMetadata {
                    Code = 200, Message = "Customer Added"
                },
            }, new[]
            {
                new Parameter {
                    Name = "service", In = ParameterIn.Path, Required = true, Description = "The service's name", Default = "Nancy Swagger Service", Type = "string"
                },
                new BodyParameter <ServiceCustomer>(ModelCatalog)
                {
                    Name = "user", Required = true, Description = "The user"
                },
            }, new []
            {
                customerSubTag
            });

            RouteDescriber.DescribeRouteWithParams <SwaggerFile>("PostCustomerReview", "", "Add a customer's review", new[]
            {
                new HttpResponseMetadata <SwaggerFile> {
                    Code = 200, Message = "Review Added"
                },
            }, new[]
            {
                new Parameter {
                    Name = "name", In = ParameterIn.Path, Required = true, Description = "The customer's name", Default = "Jill", Type = "string"
                },
                new Parameter {
                    Name = "file", In = ParameterIn.Form, Required = true, Description = "The customer's review", Type = "file"
                },
            }, new[]
            {
                customerSubTag
            })
            //If you need to add something that is not a parameter to DescribeRoute,
            //the function will return the OperationBuilder so you can add it.
            .ProduceMimeTypes(new[] { "multipart/form-data", "application/x-www-form-urlencoded" });
        }
        public SecurableItemsMetadataModule(ISwaggerModelCatalog modelCatalog, ISwaggerTagCatalog tagCatalog)
            : base(modelCatalog, tagCatalog)
        {
            RouteDescriber.DescribeRoute(
                "GetSecurableItem",
                "",
                "Gets the top level securable item by client id",
                new[]
            {
                new HttpResponseMetadata <SecurableItemApiModel>
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "OK"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.NotFound,
                    Message = "The client was not found by client id"
                }
            },
                new[]
            {
                _securableItemsTag
            }).SecurityRequirement(OAuth2ReadScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "GetSecurableItemById",
                "",
                "Gets a securable item by client id and securable item id",
                new[]
            {
                new HttpResponseMetadata <SecurableItemApiModel>
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "OK"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.NotFound,
                    Message = "The client was not found by client id or the securable item was not found"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.BadRequest,
                    Message = "The securable item id must be a guid"
                }
            },
                new[]
            {
                _securableItemIdParameter
            },
                new[]
            {
                _securableItemsTag
            }).SecurityRequirement(OAuth2ReadScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "AddSecurableItem",
                "",
                "Add a new securable item to the specified securable item hierarchy",
                new[]
            {
                new HttpResponseMetadata <SecurableItemApiModel>
                {
                    Code    = (int)HttpStatusCode.Created,
                    Message = "Created"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.BadRequest,
                    Message =
                        "The securable item id is not a guid or the securable item failed validation"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.NotFound,
                    Message =
                        "The client was not found by client id or the specified securable item by id was not found"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Conflict,
                    Message = "The securable item with the specified id already exists"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.UnsupportedMediaType,
                    Message = "Content-Type header was not included in request"
                }
            },
                new[]
            {
                _securableItemIdParameter,
                new BodyParameter <SecurableItemApiModel>(modelCatalog)
                {
                    Name        = "Securable Item",
                    Description = "The securable item to add"
                }
            },
                new[]
            {
                _securableItemsTag
            }).SecurityRequirement(OAuth2WriteScopeBuilder);
        }
Exemple #6
0
        public ClientsMetadataModule(ISwaggerModelCatalog modelCatalog, ISwaggerTagCatalog tagCatalog)
            : base(modelCatalog, tagCatalog)
        {
            modelCatalog.AddModels(
                typeof(SecurableItemApiModel),
                typeof(DateTime?),
                typeof(InnerError));

            RouteDescriber.DescribeRoute(
                "GetClients",
                "",
                "Gets all registered clients",
                new[]
            {
                new HttpResponseMetadata <ClientApiModel> {
                    Code = (int)HttpStatusCode.OK, Message = "OK"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                }
            },
                new[]
            {
                _clientsTag
            }).SecurityRequirement(OAuth2ManageClientsAndReadScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "GetClient",
                "",
                "Gets a single client",
                new[]
            {
                new HttpResponseMetadata <ClientApiModel>
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "Client found"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.NotFound,
                    Message = "Client with specified id was not found"
                }
            },
                new[]
            {
                _clientIdParameter
            },
                new[]
            {
                _clientsTag
            }).SecurityRequirement(OAuth2ManageClientsAndReadScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "AddClient",
                "",
                "Registers a new client",
                new[]
            {
                new HttpResponseMetadata <ClientApiModel>
                {
                    Code    = (int)HttpStatusCode.Created,
                    Message = "Created"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.BadRequest,
                    Message = "Client object in body failed validation"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.Conflict,
                    Message = "Client with specified id already exists"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.UnsupportedMediaType,
                    Message = "Content-Type header was not included in request"
                }
            },
                new[]
            {
                new BodyParameter <ClientApiModel>(modelCatalog)
                {
                    Name        = "Client",
                    Description = "The client to register"
                }
            },
                new[]
            {
                _clientsTag
            }).SecurityRequirement(OAuth2ManageClientsAndWriteScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "DeleteClient",
                "",
                "Deletes a client",
                new[]
            {
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.NoContent,
                    Message = "Client deleted"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.NotFound,
                    Message = "Client with specified id was not found"
                }
            },
                new[]
            {
                _clientIdParameter
            },
                new[]
            {
                _clientsTag
            }).SecurityRequirement(OAuth2ManageClientsAndWriteScopeBuilder);
        }
        public HeroMetadataModule(ISwaggerModelCatalog modelCatalog, ISwaggerTagCatalog tagCatalog) : base(modelCatalog, tagCatalog)
        {
            //modelCatalog.AddModels(typeof(Hero));
            //modelCatalog.AddModel<Hero>();

            RouteDescriber.AddBaseTag(new Swagger.ObjectModel.Tag()
            {
                Name = "Hero", Description = "Operations for handling hero objects"
            });

            RouteDescriber.DescribeRouteWithParams <Hero>("GetHero", "", "Get Hero", new[]
            {
                new HttpResponseMetadata {
                    Code = (int)HttpStatusCode.OK, Message = "A hero object is returned."
                },
                new HttpResponseMetadata {
                    Code = (int)HttpStatusCode.NotFound, Message = "No hero was found with the name specified in the request."
                }
            },
                                                          new[]
            {
                new Swagger.ObjectModel.Parameter
                {
                    Name        = "name",
                    In          = Swagger.ObjectModel.ParameterIn.Path,
                    Description = "The name of the hero to return.",
                    Required    = true,
                    Type        = "string"
                }
            });

            RouteDescriber.DescribeRouteWithParams("DeleteHero", "", "Delete Hero", new[]
            {
                new HttpResponseMetadata {
                    Code = (int)HttpStatusCode.NoContent, Message = "The object was successfully deleted or did not exist to begin with."
                }
            },
                                                   new[]
            {
                new Swagger.ObjectModel.Parameter
                {
                    Name        = "name",
                    In          = Swagger.ObjectModel.ParameterIn.Path,
                    Description = "The name of the hero to delete.",
                    Required    = true,
                    Type        = "string"
                }
            });

            RouteDescriber.DescribeRoute <Hero[]>("GetHeroList", "", "Get Hero List", new[]
            {
                new HttpResponseMetadata {
                    Code = (int)HttpStatusCode.OK, Message = "An array with hero objects is returned."
                }
            });

            RouteDescriber.DescribeRouteWithParams("PutHero", "", "Put Hero", new[]
            {
                new HttpResponseMetadata {
                    Code = (int)HttpStatusCode.Created, Message = "The hero object was created/updated."
                },
                new HttpResponseMetadata {
                    Code = (int)HttpStatusCode.BadRequest, Message = "The body of the request does not conform to the Hero model."
                }
            },
                                                   new[]
            {
                new Swagger.ObjectModel.Parameter
                {
                    Name        = "hero",
                    In          = Swagger.ObjectModel.ParameterIn.Body,
                    Description = "The Hero object to put. If an object with the same name exists it will be replaced.",
                    Required    = true,
                    Type        = "Hero"
                }
            });
        }
        public ConfigurationNancyMetadataModule(
            ISwaggerModelCatalog modelCatalog,
            ISwaggerTagCatalog tagCatalog)
            : base(modelCatalog, tagCatalog)
        {
            var configurationStoreTag = new Tag
            {
                Name        = "Configuration",
                Description = "Operations to manage configuration values"
            };

            RouteDescriber
            .AddAdditionalModels(typeof(Nav));
            RouteDescriber
            .AddAdditionalModels(typeof(ConfigKeyListItem));
            RouteDescriber
            .AddAdditionalModels(typeof(ValueType));

            RouteDescriber.DescribeRoute <IEnumerable <ConfigKeyListItem> >(
                RouteRegistry.Api.Configuration.GetConfigs.Name,
                "Gets a summary of all configuration keys available",
                "Gets a summary of all configuration keys available",
                new[]
            {
                new HttpResponseMetadata <IEnumerable <ConfigKeyListItem> >
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "OK"
                }
            },
                new[]
            {
                configurationStoreTag
            });

            RouteDescriber.DescribeRouteWithParams <ConfigValueListItem>(
                RouteRegistry.Api.Configuration.GetConfigForVersion.Name,
                "Gets the latest configuration value for the environment tag specified in the defined version",
                "Gets configuration value for environment",
                new[]
            {
                new HttpResponseMetadata <ConfigValueListItem>
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "OK"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.NotFound,
                    Message = "Configuration key or value for environment not found"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.NotModified,
                    Message = "Configuration value found for environment, but no change from client version"
                }
            },
                new[]
            {
                new Parameter
                {
                    Name        = "configKey",
                    In          = ParameterIn.Path,
                    Required    = true,
                    Description = "The configuration's key",
                    Type        = "string"
                },
                new Parameter
                {
                    Name        = "configVersion:version",
                    In          = ParameterIn.Path,
                    Required    = true,
                    Description = "The configuration's value version (semantic version format)",
                    Type        = "string"
                },
                new Parameter
                {
                    Name        = "envTag",
                    In          = ParameterIn.Path,
                    Required    = true,
                    Description = "The configuration's environment",
                    Type        = "string"
                },
                new Parameter
                {
                    Name        = "seq",
                    In          = ParameterIn.Query,
                    Required    = false,
                    Description = "Current sequence value held by client",
                    Type        = "integer"
                }
            },
                new[]
            {
                configurationStoreTag
            });

            RouteDescriber.DescribeRouteWithParams(
                RouteRegistry.Api.Configuration.AddNewConfiguration.Name,
                "Adds a new configuration key with a given value type",
                "Add a new configuration key",
                new[]
            {
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "OK"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.BadRequest,
                    Message = "Request received does not match expectation"
                }
            },
                new[]
            {
                new Parameter
                {
                    Name        = "configKey",
                    In          = ParameterIn.Path,
                    Required    = true,
                    Description = "The configuration's key",
                    Type        = "string"
                },
                new BodyParameter <NewConfigurationRequest>(modelCatalog)
                {
                    Name        = "new configuration",
                    Required    = true,
                    Description = "The configuration definition"
                }
            },
                new[]
            {
                configurationStoreTag
            });

            RouteDescriber.DescribeRouteWithParams(
                RouteRegistry.Api.Configuration.AddNewValueToConfiguration.Name,
                "Adds a new configuration value to an existing key, used to add values to a different set of environments",
                "Add a new configuration value for the key",
                new[]
            {
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "OK"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.BadRequest,
                    Message = "Request received does not match expectation"
                }
            },
                new[]
            {
                new Parameter
                {
                    Name        = "configKey",
                    In          = ParameterIn.Path,
                    Required    = true,
                    Description = "The configuration key",
                    Type        = "string"
                },
                new Parameter
                {
                    Name        = "configVersion:version",
                    In          = ParameterIn.Path,
                    Required    = true,
                    Description = "The configuration key's version",
                    Type        = "string"
                },
                new BodyParameter <NewValueToConfigurationRequest>(modelCatalog)
                {
                    Name        = "new configuration value",
                    Required    = true,
                    Description = "The configuration value definition"
                }
            },
                new[]
            {
                configurationStoreTag
            });

            RouteDescriber.DescribeRouteWithParams(
                RouteRegistry.Api.Configuration.UpdateValueOnConfiguration.Name,
                "Updates a specific configuration value, bumping the sequence number",
                "Updates a configuration value",
                new[]
            {
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "OK"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.BadRequest,
                    Message = "Request received does not match expectation"
                }
            },
                new[]
            {
                new Parameter
                {
                    Name        = "configKey",
                    In          = ParameterIn.Path,
                    Required    = true,
                    Description = "The configuration key",
                    Type        = "string"
                },
                new Parameter
                {
                    Name        = "configVersion:version",
                    In          = ParameterIn.Path,
                    Required    = true,
                    Description = "The configuration key's version",
                    Type        = "string"
                },
                new Parameter
                {
                    Name        = "valueId:guid",
                    In          = ParameterIn.Path,
                    Required    = true,
                    Description = "The configuration value's identifier",
                    Type        = "string"
                },
                new BodyParameter <UpdateValueOnConfigurationRequest>(modelCatalog)
                {
                    Name        = "new configuration value",
                    Required    = true,
                    Description = "The configuration value definition"
                }
            },
                new[]
            {
                configurationStoreTag
            });

            RouteDescriber.DescribeRouteWithParams(
                RouteRegistry.Api.Configuration.DeleteConfiguration.Name,
                "Deletes a specific configuration key, with all versions and all their values",
                "Deletes a configuration key",
                new[]
            {
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "Deleted configuration key"
                },
            },
                new[]
            {
                new Parameter
                {
                    Name        = "configKey",
                    In          = ParameterIn.Path,
                    Required    = true,
                    Description = "The configuration key",
                    Type        = "string"
                }
            },
                new[]
            {
                configurationStoreTag
            });

            RouteDescriber.DescribeRouteWithParams(
                RouteRegistry.Api.Configuration.DeleteValueFromConfiguration.Name,
                "Deletes a specific configuration value for a key with a specific version",
                "Deletes a configuration key",
                new[]
            {
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "Deleted configuration key"
                },
            },
                new[]
            {
                new Parameter
                {
                    Name        = "configKey",
                    In          = ParameterIn.Path,
                    Required    = true,
                    Description = "The configuration key",
                    Type        = "string"
                },
                new Parameter
                {
                    Name        = "configVersion:version",
                    In          = ParameterIn.Path,
                    Required    = true,
                    Description = "The configuration key's version",
                    Type        = "string"
                },
                new Parameter
                {
                    Name        = "valueId:guid",
                    In          = ParameterIn.Path,
                    Required    = true,
                    Description = "The configuration value's identifier",
                    Type        = "string"
                }
            },
                new[]
            {
                configurationStoreTag
            });
        }
        public UsersMetadataModule(ISwaggerModelCatalog modelCatalog, ISwaggerTagCatalog tagCatalog)
            : base(modelCatalog, tagCatalog)
        {
            ModelCatalog.AddModels(typeof(PermissionAction));

            RouteDescriber.DescribeRoute(
                "GetUserPermissions",
                "",
                "Gets permissions for a user",
                new[]
            {
                new HttpResponseMetadata <UserPermissionsApiModel> {
                    Code = (int)HttpStatusCode.OK, Message = "OK"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                }
            },
                new[]
            {
                _usersTag
            }).SecurityRequirement(OAuth2ReadScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "AddGranularPermissions",
                "",
                "Adds granular permissions for a user, either to allow or deny",
                new[]
            {
                new HttpResponseMetadata {
                    Code = (int)HttpStatusCode.NoContent
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                }
            },
                new[]
            {
                _identityProviderParameter,
                _subjectIdParameter,
                new BodyParameter <List <PermissionApiModel> >(modelCatalog)
                {
                    Name        = "GranularPermissions",
                    Description = "The permissions to add for the user."
                }
            },
                new[]
            {
                _usersTag
            }).SecurityRequirement(OAuth2ManageClientsScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "DeleteGranularPermissions",
                "",
                "Deletes granular permissions for a user",
                new[]
            {
                new HttpResponseMetadata {
                    Code = (int)HttpStatusCode.NoContent
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                }
            },
                new[]
            {
                _identityProviderParameter,
                _subjectIdParameter,
                new BodyParameter <List <PermissionApiModel> >(modelCatalog)
                {
                    Name        = "GranularPermissions",
                    Description = "The permissions to delete from the user."
                }
            },
                new[]
            {
                _usersTag
            }).SecurityRequirement(OAuth2ManageClientsScopeBuilder);

            RouteDescriber.DescribeRouteWithParams(
                "GetUserGroups",
                "",
                "Gets custom groups for a user",
                new[]
            {
                new HttpResponseMetadata <IEnumerable <string> >
                {
                    Code    = (int)HttpStatusCode.OK,
                    Message = "List of strings representing group names in which the user belongs"
                },
                new HttpResponseMetadata
                {
                    Code    = (int)HttpStatusCode.Forbidden,
                    Message = "Client does not have access"
                },
                new HttpResponseMetadata <Error>
                {
                    Code    = (int)HttpStatusCode.NotFound,
                    Message = "User was not found"
                }
            },
                new[]
            {
                _subjectIdParameter
            },
                new[]
            {
                _usersTag
            }).SecurityRequirement(OAuth2ReadScopeBuilder);
        }