Skip to content

Commit

Permalink
fix(doc/rest-api): fix response schema when upsert content
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshinorin committed Dec 4, 2024
1 parent b46c69a commit 7ca6013
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 29 deletions.
36 changes: 8 additions & 28 deletions docs/rest-api/components/schemas/response/content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,18 @@ properties:
type: string
format: ulid
example: "01fgvhjxftxfjvxg3xbvv78kr1"
path:
type: string
example: "/2020/01/01/new-year"
title:
type: string
example: "Post Title"
robotsAttributes:
type: string
description: "Comma separated values."
example: "noarchive, noimageindex"
externalResources:
type: array
items:
$ref: '../common/externalResource.yml'
tags:
type: array
items:
$ref: '../common/tag.yml'
description:
rawContent:
type: string
example: "Post description... not HTML strings"
content:
htmlContent:
type: string
example: "Post Content.... HTML strings"
length:
type: integer
example: 1252
authorName:
type: string
description: "This field return from `authors.display_name` column value."
example: "Jhon Due"
publishedAt:
type: long
description: Unix time
Expand All @@ -52,13 +36,9 @@ required:
- id
- authorId
- contentTypeId
- path
- title
- robotsAttributes
- externalResources
- tags
- description
- content
- length
- authorName
- rawContent
- htmlContent
- publishedAt
- updatedAt
54 changes: 54 additions & 0 deletions docs/rest-api/components/schemas/response/contentDetail.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
type: object
properties:
id:
type: string
format: ulid
example: "01fgvhme5b7cj0m5agr9f4g2ca"
title:
type: string
example: "Post Title"
robotsAttributes:
type: string
description: "Comma separated values."
example: "noarchive, noimageindex"
externalResources:
type: array
items:
$ref: '../common/externalResource.yml'
tags:
type: array
items:
$ref: '../common/tag.yml'
description:
type: string
example: "Post description... not HTML strings"
content:
type: string
example: "Post Content.... HTML strings"
length:
type: integer
example: 1252
authorName:
type: string
description: "This field return from `authors.display_name` column value."
example: "Jhon Due"
publishedAt:
type: long
description: Unix time
example: 1625065509
updatedAt:
type: long
description: Unix time
example: 1627095819
required:
- id
- title
- robotsAttributes
- externalResources
- tags
- description
- content
- length
- authorName
- publishedAt
- updatedAt
2 changes: 1 addition & 1 deletion docs/rest-api/paths/v1/contents/getByPath.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ get:
content:
application/json:
schema:
$ref: '../../../components/schemas/response/content.yml'
$ref: '../../../components/schemas/response/contentDetail.yml'
404:
description: Content not found
content:
Expand Down

0 comments on commit 7ca6013

Please sign in to comment.