From 9a3c5947225bce4a6b970566344781b681e4155d Mon Sep 17 00:00:00 2001 From: kumachan-mis <29433058+kumachan-mis@users.noreply.github.com> Date: Sat, 14 Sep 2024 18:57:07 +0900 Subject: [PATCH] docs: provide schemas useful for frontend development --- docs/openapi/_index.yaml | 3 +++ docs/openapi/schemas/_index.yaml | 9 +++++++++ .../schemas/entity/graph/GraphContent.yaml | 1 - .../graph/GraphContentWithoutAutofield.yaml | 12 ++++++++++++ .../GraphContentWithoutAutofieldError.yaml | 7 +++++++ .../entity/paper/PaperWithoutAutofield.yaml | 15 +++++++++++++++ .../paper/PaperWithoutAutofieldError.yaml | 7 +++++++ .../model_graph_content_without_autofield.go | 17 +++++++++++++++++ ...del_graph_content_without_autofield_error.go | 17 +++++++++++++++++ internal/model/model_paper_without_autofield.go | 17 +++++++++++++++++ .../model_paper_without_autofield_error.go | 17 +++++++++++++++++ 11 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 docs/openapi/schemas/_index.yaml create mode 100644 docs/openapi/schemas/entity/graph/GraphContentWithoutAutofield.yaml create mode 100644 docs/openapi/schemas/entity/graph/GraphContentWithoutAutofieldError.yaml create mode 100644 docs/openapi/schemas/entity/paper/PaperWithoutAutofield.yaml create mode 100644 docs/openapi/schemas/entity/paper/PaperWithoutAutofieldError.yaml create mode 100644 internal/model/model_graph_content_without_autofield.go create mode 100644 internal/model/model_graph_content_without_autofield_error.go create mode 100644 internal/model/model_paper_without_autofield.go create mode 100644 internal/model/model_paper_without_autofield_error.go diff --git a/docs/openapi/_index.yaml b/docs/openapi/_index.yaml index 833d20b..5388b73 100644 --- a/docs/openapi/_index.yaml +++ b/docs/openapi/_index.yaml @@ -5,3 +5,6 @@ info: description: App to Create Graphically-Summarized Notes in Three Steps paths: $ref: ./paths/_index.yaml +components: + schemas: + $ref: ./schemas/_index.yaml diff --git a/docs/openapi/schemas/_index.yaml b/docs/openapi/schemas/_index.yaml new file mode 100644 index 0000000..afee0d6 --- /dev/null +++ b/docs/openapi/schemas/_index.yaml @@ -0,0 +1,9 @@ +# List of unused schemas. These are not used in API definitions but useful for frontend development. +PaperWithoutAutofield: + $ref: ./entity/paper/PaperWithoutAutofield.yaml +PaperWithoutAutofieldError: + $ref: ./entity/paper/PaperWithoutAutofieldError.yaml +GraphContentWithoutAutofield: + $ref: ./entity/graph/GraphContentWithoutAutofield.yaml +GraphContentWithoutAutofieldError: + $ref: ./entity/graph/GraphContentWithoutAutofieldError.yaml diff --git a/docs/openapi/schemas/entity/graph/GraphContent.yaml b/docs/openapi/schemas/entity/graph/GraphContent.yaml index 30a9ff0..ac7c9c8 100644 --- a/docs/openapi/schemas/entity/graph/GraphContent.yaml +++ b/docs/openapi/schemas/entity/graph/GraphContent.yaml @@ -14,5 +14,4 @@ properties: This is the introduction of the paper. required: - id - - name - paragraph diff --git a/docs/openapi/schemas/entity/graph/GraphContentWithoutAutofield.yaml b/docs/openapi/schemas/entity/graph/GraphContentWithoutAutofield.yaml new file mode 100644 index 0000000..be746dc --- /dev/null +++ b/docs/openapi/schemas/entity/graph/GraphContentWithoutAutofield.yaml @@ -0,0 +1,12 @@ +type: object +description: Graph object with only content fields without auto-generated fields +properties: + paragraph: + type: string + maxLength: 40000 + description: Graph paragraph + example: | + ## Introduction + This is the introduction of the paper. +required: + - paragraph diff --git a/docs/openapi/schemas/entity/graph/GraphContentWithoutAutofieldError.yaml b/docs/openapi/schemas/entity/graph/GraphContentWithoutAutofieldError.yaml new file mode 100644 index 0000000..4dbac3e --- /dev/null +++ b/docs/openapi/schemas/entity/graph/GraphContentWithoutAutofieldError.yaml @@ -0,0 +1,7 @@ +type: object +description: Error Message for GraphContentWithoutAutofield object +properties: + paragraph: + type: string + description: Error message for graph paragraph + example: graph paragraph must be less than or equal to 40000 bytes diff --git a/docs/openapi/schemas/entity/paper/PaperWithoutAutofield.yaml b/docs/openapi/schemas/entity/paper/PaperWithoutAutofield.yaml new file mode 100644 index 0000000..4885d90 --- /dev/null +++ b/docs/openapi/schemas/entity/paper/PaperWithoutAutofield.yaml @@ -0,0 +1,15 @@ +type: object +description: Paper object without auto-generated fields +properties: + content: + type: string + maxLength: 40000 + description: Paper content + example: | + ## Introduction + This is the introduction of the paper. + + ## What is note apps? + Note apps is a web application that allows users to create, read, update, and delete notes. +required: + - content diff --git a/docs/openapi/schemas/entity/paper/PaperWithoutAutofieldError.yaml b/docs/openapi/schemas/entity/paper/PaperWithoutAutofieldError.yaml new file mode 100644 index 0000000..5bf5d7e --- /dev/null +++ b/docs/openapi/schemas/entity/paper/PaperWithoutAutofieldError.yaml @@ -0,0 +1,7 @@ +type: object +description: Error Message for PaperWithoutAutofield object +properties: + content: + type: string + description: Error message for paper content + example: paper content must be less than or equal to 40000 bytes diff --git a/internal/model/model_graph_content_without_autofield.go b/internal/model/model_graph_content_without_autofield.go new file mode 100644 index 0000000..cc2d36a --- /dev/null +++ b/internal/model/model_graph_content_without_autofield.go @@ -0,0 +1,17 @@ +/* + * Web API of kNODEledge + * + * App to Create Graphically-Summarized Notes in Three Steps + * + * API version: 0.1.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package model + +// GraphContentWithoutAutofield - Graph object with only content fields without auto-generated fields +type GraphContentWithoutAutofield struct { + + // Graph paragraph + Paragraph string `json:"paragraph"` +} diff --git a/internal/model/model_graph_content_without_autofield_error.go b/internal/model/model_graph_content_without_autofield_error.go new file mode 100644 index 0000000..af9f593 --- /dev/null +++ b/internal/model/model_graph_content_without_autofield_error.go @@ -0,0 +1,17 @@ +/* + * Web API of kNODEledge + * + * App to Create Graphically-Summarized Notes in Three Steps + * + * API version: 0.1.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package model + +// GraphContentWithoutAutofieldError - Error Message for GraphContentWithoutAutofield object +type GraphContentWithoutAutofieldError struct { + + // Error message for graph paragraph + Paragraph string `json:"paragraph,omitempty"` +} diff --git a/internal/model/model_paper_without_autofield.go b/internal/model/model_paper_without_autofield.go new file mode 100644 index 0000000..d2ed081 --- /dev/null +++ b/internal/model/model_paper_without_autofield.go @@ -0,0 +1,17 @@ +/* + * Web API of kNODEledge + * + * App to Create Graphically-Summarized Notes in Three Steps + * + * API version: 0.1.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package model + +// PaperWithoutAutofield - Paper object without auto-generated fields +type PaperWithoutAutofield struct { + + // Paper content + Content string `json:"content"` +} diff --git a/internal/model/model_paper_without_autofield_error.go b/internal/model/model_paper_without_autofield_error.go new file mode 100644 index 0000000..22e6e79 --- /dev/null +++ b/internal/model/model_paper_without_autofield_error.go @@ -0,0 +1,17 @@ +/* + * Web API of kNODEledge + * + * App to Create Graphically-Summarized Notes in Three Steps + * + * API version: 0.1.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package model + +// PaperWithoutAutofieldError - Error Message for PaperWithoutAutofield object +type PaperWithoutAutofieldError struct { + + // Error message for paper content + Content string `json:"content,omitempty"` +}