Skip to content

Commit

Permalink
fix(cli): ir generation accurately generates examples for objects wit…
Browse files Browse the repository at this point in the history
…h extends (#4408)
  • Loading branch information
dsinghvi authored Aug 23, 2024
1 parent 6f002b5 commit bd78b58
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
22 changes: 22 additions & 0 deletions packages/cli/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.39.17] - 2024-08-21

- Fix: Previously, object declarations with extends and no properties did not have examples
propagating in the Docs and SDKs. The core issue was in IR generation which has now
been resolved.

The following will now work as expected:

```yaml
types:

ObjectWithNoProperties:
extends:
- ParentA
- ParentB
examples:
- name: Default
value:
propertyFromParentA: foo
propertyFromParentB: bar
```
## [0.39.16] - 2024-08-21
- Chore: Support running 0.2.x versions of the Postman Generator with IR V53 or above.
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/cli/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.39.16
0.39.17
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ function convertObject({
}
return ExampleTypeShape.object({
properties:
rawObject.properties != null
rawObject.properties != null || rawObject.extends != null
? Object.entries(example).reduce<ExampleObjectProperty[]>(
(exampleProperties, [wireKey, propertyExample]) => {
const originalTypeDeclaration = getOriginalTypeDeclarationForProperty({
Expand Down
3 changes: 2 additions & 1 deletion seed/ts-sdk/seed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ local:
env:
NODE_ENV: test
customFixtureConfig:
generateWireTests: true
customConfig:
generateWireTests: true
fixtures:
imdb:
- customConfig: null
Expand Down

0 comments on commit bd78b58

Please sign in to comment.