ePages-de / ePages-de/restdocs-api-spec

generated response schemata have properties with "null" type

Open
#134 3 comments 0 reactions 0 assignees View on GitHub
bug
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.