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

View File

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