Skip to content

Commit

Permalink
added documentation for query parameters #78
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsilva committed Jul 7, 2017
1 parent 1783a9a commit 03c216d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
37 changes: 23 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,20 +214,20 @@ Note: make sure you add at least the `DataContract` and `DataMember` attributes

## Attributes

| Attribute | Used in | Description | Options |
| ---------------------- |------------------------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------- |
| `SwaggerWcf` | `Class`, `Interface` | Enable parsing WCF service | `ServicePath` |
| `SwaggerWcfHidden` | `Class`, `Method`, `Property`, `Parameter` | Hide element from Swagger | |
| `SwaggerWcfTag` | `Class`, `Method`, `Property`, `Parameter` | Add a tag to an element | `TagName`, `HideFromSpec` |
| `SwaggerWcfHeader` | `Method` | Configure method HTTP headers | `Name`, `Required`, `Description`, `DefaultValue` |
| `SwaggerWcfPath` | `Method` | Configure a method in Swagger | `Summary`, `Description`, `OperationId`, `ExternalDocsDescription`, `ExternalDocsUrl`, `Deprecated` |
| `SwaggerWcfParameter` | `Parameter` | Configure method parameters | `Required`, `Description` |
| `SwaggerWcfProperty` | `Property` | Configure property parameters | `Required`, `Description`, `Minimum`, `Maximum`, `Default`, ... |
| `SwaggerWcfResponse` | `Method` | Configure method return value | `Code`, `Description`, `EmptyResponseOverride`, `Headers` |
| `SwaggerWcfDefinition` | `Class` | Configure a data type | `ExternalDocsDescription`, `ExternalDocsUrl` |
| `SwaggerWcfReturnType` | `Method` | Override method return type | `ReturnType` |
| `SwaggerWcfContentTypes` | `Method` | Override consume/produce content-types | `ConsumeTypes`, `ProduceTypes` |
| `SwaggerWcfSecurity` | `Method` | Add security background to this method | `SecurityDefinitionName`, `params Scopes` |
| Attribute | Used in | Description | Options |
| ------------------------ |------------------------------------------- | -------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `SwaggerWcf` | `Class`, `Interface` | Enable parsing WCF service | `ServicePath` |
| `SwaggerWcfHidden` | `Class`, `Method`, `Property`, `Parameter` | Hide element from Swagger | |
| `SwaggerWcfTag` | `Class`, `Method`, `Property`, `Parameter` | Add a tag to an element | `TagName`, `HideFromSpec` |
| `SwaggerWcfHeader` | `Method` | Configure method HTTP headers | `Name`, `Required`, `Description`, `DefaultValue` |
| `SwaggerWcfPath` | `Method` | Configure a method in Swagger | `Summary`, `Description`, `OperationId`, `ExternalDocsDescription`, `ExternalDocsUrl`, `Deprecated` |
| `SwaggerWcfParameter` | `Parameter` | Configure method parameters | `Required`, `Description`, `ParameterType` |
| `SwaggerWcfProperty` | `Property` | Configure property parameters | `Required`, `Description`, `Minimum`, `Maximum`, `Default`, ... |
| `SwaggerWcfResponse` | `Method` | Configure method return value | `Code`, `Description`, `EmptyResponseOverride`, `Headers` |
| `SwaggerWcfDefinition` | `Class` | Configure a data type | `ExternalDocsDescription`, `ExternalDocsUrl` |
| `SwaggerWcfReturnType` | `Method` | Override method return type | `ReturnType` |
| `SwaggerWcfContentTypes` | `Method` | Override consume/produce content-types | `ConsumeTypes`, `ProduceTypes` |
| `SwaggerWcfSecurity` | `Method` | Add security background to this method | `SecurityDefinitionName`, `params Scopes` |


## Tags
Expand All @@ -243,6 +243,15 @@ This will prevent this tag to be displayed in the Swagger output.

When combined with `SwaggerWcfHidden`, if the tag has the value `visible` as `true` in `web.config` file, the element will be visible

## Query Parameter

To specify query parameters to a function you may use the following syntax

```csharp
[WebGet(UriTemplate = "/books?filter={filter}", BodyStyle = WebMessageBodyStyle.Bare)]
Book[] ReadBooks(string filter = null);
```

## Optional Parameters

To specify a paramter as optional for swagger-ui provide a default value for the parameter on the interface.
Expand Down
2 changes: 1 addition & 1 deletion src/SwaggerWcf/SwaggerWcf.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<projectUrl>https://github.com/abelsilva/swaggerwcf</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>$description$</description>
<releaseNotes>added support for overriding parameter types #78</releaseNotes>
<releaseNotes>added support for overriding parameter types #80</releaseNotes>
<copyright>Copyright 2015</copyright>
<tags>swagger wcf .net c#</tags>
</metadata>
Expand Down

0 comments on commit 03c216d

Please sign in to comment.