Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
What's new
2
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Projects
Groups
Snippets
Sign up now
Login
Sign in / Register
Toggle navigation
Menu
Open sidebar
tanna.dev
jvt.me
Commits
7d18a8da
Commit
7d18a8da
authored
Oct 20, 2022
by
Jamie Tanna
Browse files
Add note about removing `additionalProperties` on responses
parent
74c43c53
Pipeline
#672519222
passed with stages
in 9 minutes and 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
content/posts/2022-10-20-rails-openapi-contract-test-retrofit.md
View file @
7d18a8da
...
...
@@ -155,7 +155,7 @@ paths:
application/json
:
schema
:
type
:
object
additionalProperties
:
false
# note that we remove additionalProperties to prevent clients from unexpectedly breaking when new fields are sent
properties
:
status
:
type
:
string
...
...
@@ -193,7 +193,6 @@ I'd also recommend converting this to a reference, so code generators can genera
+ schemas:
+ Healthcheck:
+ type: object
+ additionalProperties: false
+ properties:
+ status:
+ type: string
...
...
@@ -345,12 +344,12 @@ And at this point we can now start to implement the response body. We can start
+ id: {}
```
Doing this one-by-one allows our test to pass:
Doing this one-by-one allows our test to pass
, and remove
`additionalProperties`
once passing
:
```
diff
City:
type: object
additionalProperties: false
-
additionalProperties: false
properties:
id: {}
+ name: {}
...
...
@@ -385,7 +384,6 @@ components:
# ...
City
:
type
:
object
additionalProperties
:
false
properties
:
id
:
type
:
int
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment