-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Início dos testes usando o Redoc como gerador de documentação automát…
…ica.
- Loading branch information
1 parent
4d6e3e1
commit 0a4e06a
Showing
15 changed files
with
654 additions
and
1,112 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Auto-documentação | ||
|
||
Liquido utiliza a OpenAPI para documentação REST, versão 3.0.0. Todos os tipos e interfaces definidos aqui são utilizados para gerar um YAML que gera uma documentação OpenAPI. Os nomes das propriedades, portanto, serão em inglês. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { InfoOpenApi } from "./info-open-api"; | ||
import { MetodoHttpOpenApi } from "./metodo-http-open-api"; | ||
import { RotaOpenApi } from "./rota-open-api"; | ||
import { ServerOpenApi } from "./server-open-api"; | ||
import { TagDocumentoOpenApi } from "./tag-documento-open-api"; | ||
|
||
export interface DocumentoOpenApi { | ||
openapi: '3.0.0'; | ||
servers: ServerOpenApi[]; | ||
info: InfoOpenApi; | ||
tags?: TagDocumentoOpenApi[]; | ||
paths?: {[key: string]: {[key in MetodoHttpOpenApi]?: RotaOpenApi}} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './documento-open-api'; | ||
export * from './metodo-http-open-api'; | ||
export * from './rota-open-api'; | ||
export * from './server-open-api'; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { LicenseOpenApi } from "./license-open-api"; | ||
|
||
export interface InfoOpenApi { | ||
description: string; | ||
version: string; | ||
title: string; | ||
license: LicenseOpenApi; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface LicenseOpenApi { | ||
name: string; | ||
url: string; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type MetodoHttpOpenApi = 'get' | 'post' | 'put' | 'delete' | 'patch'; |
5 changes: 5 additions & 0 deletions
5
infraestrutura/auto-documentacao/response-content-open-api.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface ResponseContentOpenApi { | ||
type?: string | ||
items?: any[] | ||
schema?: any; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { ResponseContentOpenApi } from "./response-content-open-api"; | ||
|
||
export interface ResponseOpenApi { | ||
description: string; | ||
content?: {[key: string]: ResponseContentOpenApi} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ResponseOpenApi } from "./response-open-api"; | ||
|
||
export interface RotaOpenApi { | ||
tags: string[]; | ||
summary: string; | ||
description: string; | ||
operationId: string; | ||
responses: {[key: string]: ResponseOpenApi}; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface ServerOpenApi { | ||
url: string; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface TagDocumentoOpenApi { | ||
name: string; | ||
description: string; | ||
} |
5 changes: 5 additions & 0 deletions
5
interface-linha-comando/exemplos/api-rest/configuracao.delegua
This file contains 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
This file contains 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
Oops, something went wrong.