-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): fern definition respects extra-properties when validating e…
…xamples (#5520)
- Loading branch information
Showing
8 changed files
with
142 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## 0.46.18 | ||
**`(fix):`** If an object or request is annotated with `extra-properties: true` then the user can provide an example that includes | ||
extra properties that are no longer in the schema. | ||
|
||
For example, check out this fern definition | ||
|
||
```yml service.yml | ||
types: | ||
Item: | ||
extra-properties: true | ||
properties: | ||
id: string | ||
|
||
|
||
service: | ||
auth: false | ||
base-path: "" | ||
endpoints: | ||
create: | ||
method: POST | ||
path: /item | ||
request: | ||
name: CreateItemRequest | ||
body: | ||
extra-properties: true | ||
properties: | ||
id: string | ||
response: | ||
type: Item | ||
examples: | ||
- name: "Item" | ||
request: | ||
id: "123" | ||
foo: "bar" # extra property in the example | ||
response: | ||
body: | ||
id: "123" | ||
foo: "bar" # extra property in the example | ||
``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...c/rules/valid-example-endpoint-call/__test__/fixtures/extra-properties/definition/api.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: extra-properties | ||
auth: bearer | ||
default-environment: Production |
32 changes: 32 additions & 0 deletions
32
...-example-endpoint-call/__test__/fixtures/extra-properties/definition/extra-properties.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
types: | ||
Item: | ||
extra-properties: true | ||
properties: | ||
id: string | ||
|
||
|
||
service: | ||
auth: false | ||
base-path: "" | ||
endpoints: | ||
create: | ||
method: POST | ||
path: /item | ||
request: | ||
name: CreateItemRequest | ||
body: | ||
extra-properties: true | ||
properties: | ||
id: string | ||
response: | ||
type: Item | ||
examples: | ||
- name: "Item" | ||
request: | ||
id: "123" | ||
foo: "bar" | ||
response: | ||
body: | ||
id: "123" | ||
foo: "bar" | ||
|
1 change: 1 addition & 0 deletions
1
...r/src/rules/valid-example-endpoint-call/__test__/fixtures/extra-properties/generators.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters