Add limit on content field (comment request)

This commit is contained in:
2021-04-10 21:34:51 +02:00
parent 8223dd21bb
commit 0c8bcbd634
2 changed files with 14 additions and 4 deletions

View File

@@ -567,8 +567,10 @@ paths:
properties:
content:
type: string
minLength: 20
maxLength: 6000
example:
Lorem ipsum...
Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum...
responses:
201:
description: Return created Comment
@@ -613,6 +615,8 @@ paths:
properties:
content:
type: string
minLength: 20
maxLength: 6000
example:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
responses:
@@ -647,6 +651,8 @@ paths:
properties:
content:
type: string
minLength: 20
maxLength: 6000
example:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
responses:
@@ -799,8 +805,10 @@ paths:
properties:
content:
type: string
minLength: 20
maxLength: 6000
example:
Lorem ipsum...
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
responses:
201:
description: Return created comment

View File

@@ -1,6 +1,8 @@
package integration
import fr.dcproject.component.citizen.database.CitizenI
import integration.steps.`when`.Validate.ALL
import integration.steps.`when`.Validate.REQUEST_BODY
import integration.steps.`when`.`When I send a GET request`
import integration.steps.`when`.`When I send a POST request`
import integration.steps.`when`.`When I send a PUT request`
@@ -66,7 +68,7 @@ class `Comment routes` : BaseTest() {
withIntegrationApplication {
`Given I have citizen`("Hubert", "Reeves")
`Given I have comment on comment`(id = "49933147-fc0f-4e5c-aa8d-f77fa0d88fa6")
`When I send a POST request`("/comments/49933147-fc0f-4e5c-aa8d-f77fa0d88fa6") {
`When I send a POST request`("/comments/49933147-fc0f-4e5c-aa8d-f77fa0d88fa6", ALL - REQUEST_BODY) {
`authenticated as`("Hubert", "Reeves")
`with body`(
"""
@@ -125,7 +127,7 @@ class `Comment routes` : BaseTest() {
),
id = "fd30d20f-656c-42c6-8955-f61c04537464"
)
`When I send a PUT request`("/comments/fd30d20f-656c-42c6-8955-f61c04537464") {
`When I send a PUT request`("/comments/fd30d20f-656c-42c6-8955-f61c04537464", ALL - REQUEST_BODY) {
`authenticated as`("Hubert", "Reeves")
`with body`(
"""