ePages-de / ePages-de/restdocs-api-spec
generated response schemata have properties with "null" type
- Dominant language
- Kotlin
- Stars
- 427
- Forks
- 116
- Avg merge
- 23h 54m
- Merged PRs (30d)
- 1
Description
I'm using the MockMvc wrapper class. Some of the properties in the response schemata are like
```yaml
networkIp:
description: Network IP
oneOf:
- null
- type: string
```
and the `null` type breaks OAS3 validation. I've tried to address this by specifying the type attribute on the associated test's `responseFields(fieldWithPath("networkIp").description("Network IP").type(JsonFieldType.STRING))`
The detected type is STRING whether or not I add the explicit type attribute to the field.
```bash
❯ jq '.response.responseFields[]|select(.path == "networkIp")' target/generated-snippets/create-ip-host-service/resource.json
{
"attributes": {},
"description": "Network IP",
"ignored": false,
"path": "networkIp",
"type": "STRING",
"optional": false
}
```
...and so I'm looking for validation that the problem must lie within [the Maven plugin generator](https://github.com/BerkleyTechnologyServices/restdocs-spec) that consumes the resource.json snippets in order to produce the OAS3 spec.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.