This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Custom Tool | |
| --- | |
| // Prometheus is a tool that can query Prometheus for metrics. | |
| type Prometheus struct { | |
| CallbacksHandler callbacks.Handler | |
| } | |
| var _ tools.Tool = Prometheus{} | |
| // Description returns a string describing the Prometheus tool. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { RedocStandalone } from 'redoc'; | |
| import File from './api.json' | |
| function App() { | |
| return ( | |
| <RedocStandalone | |
| specUrl={File} | |
| /> | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openapi: 3.0.0 | |
| info: | |
| title: Todo App API | |
| description: Todo App API. | |
| version: v1 | |
| contact: | |
| email: 'nicolas.tcs@hotmail.com' | |
| name: 'Nicolas Takashi' | |
| tags: | |
| - name: Tasks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| components: | |
| parameters: | |
| page: | |
| in: query | |
| description: Desired page | |
| name: page | |
| schema: | |
| type: integer | |
| format: int32 | |
| default: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| components: | |
| schemas: | |
| Task: | |
| type: object | |
| required: | |
| - name | |
| - id | |
| properties: | |
| id: | |
| description: Task unique identifier |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get: | |
| operationId: get-task | |
| summary: Get task by id | |
| description: Return a task | |
| tags: | |
| - Tasks | |
| parameters: | |
| - in: path | |
| name: id | |
| description: Task id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get: | |
| operationId: get-tasks | |
| summary: Returns a paged list of tasks. | |
| description: Returns a paged list of active tasks | |
| tags: | |
| - Tasks | |
| parameters: | |
| - $ref: '../../parameters/page-parameters.yaml#/components/parameters/page' | |
| - $ref: '../../parameters/page-parameters.yaml#/components/parameters/pageSize' | |
| responses: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openapi: 3.0.0 | |
| info: | |
| title: Todo App API | |
| description: Todo App API. | |
| version: v1 | |
| contact: | |
| email: 'nicolas.tcs@hotmail.com' | |
| name: 'Nicolas Takashi' | |
| paths: | |
| #... there more content here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var calcularSalarioTask = CalcularSalarioAsync(); | |
| calcularSalarioTask.ContinueWith(t => | |
| { | |
| var erros = t.Exception as AggregateException; | |
| if (erros == null) | |
| { | |
| Console.WriteLine(t.Result); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try | |
| { | |
| var salario = await CalculaSalarioAsync(); | |
| Console.WriteLine(salario); | |
| } | |
| catch (Exception error) | |
| { | |
| Console.WriteLine(error.Message); | |
| } |
NewerOlder