Skip to content

Commit d70eefa

Browse files
committed
Updated Swagger Support Section
1 parent 3638a22 commit d70eefa

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

doc/images/xps-helloworld.gif

-2.22 KB
Loading

doc/images/xps-swagger.gif

19 Bytes
Loading

readme.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,28 @@ When the web service is started it should display the port the service is runnin
2828

2929
![Express.NET Hello World](https://raw.githubusercontent.com/Vake93/Express.NET/main/doc/images/xps-helloworld.gif)
3030

31+
# Swagger at not extra code
32+
Express.NET generates OpenAPI documents and has built-in swagger support. No extra code required!
33+
34+
```
35+
service PersonService;
36+
37+
csharp
38+
{
39+
public record Person (string Name, int Age);
40+
public record Error (string Description);
41+
}
42+
43+
get Ok<Person> | NotFound<Error> (query string name)
44+
{
45+
if (name == "Vishvaka")
46+
return Ok(new Person("Vishvaka", 28));
47+
else
48+
return NotFound(new Error($"Person with {name} not found."));
49+
}
50+
```
51+
![Express.NET Swagger Support](https://raw.githubusercontent.com/Vake93/Express.NET/main/doc/images/xps-swagger.gif)
52+
3153
## Still this is work in progress. Things Todo
3254

3355
- [ ] Better diagnostic messages.

0 commit comments

Comments
 (0)