COVESA / COVESA/s2dm

VSpec exporter skips fields found in multiple types

Open
#152 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
17
Forks
10
Avg merge
1d 10h
Merged PRs (30d)
2

Description

Given the following GraphQL schema:

```graphql
enum RowEnum {
ROW1
ROW2
}

enum SideEnum {
DRIVERSIDE
PASSENGERSIDE
}

type DoorPosition @instanceTag {
row: RowEnum!
side: SideEnum!
}

type Door {
isLocked: Boolean
position: Int @range(min: 0, max: 100)
instanceTag: DoorPosition
}

type Vehicle {
doors: [Door] @noDuplicates
model: String
year: Int
features: [String] @noDuplicates @cardinality(min: 1, max: 10)
}

enum SeatRowEnum {
ROW1
ROW2
ROW3
}

enum SeatPositionEnum {
LEFT
CENTER
RIGHT
}

type SeatPosition @instanceTag {
row: SeatRowEnum!
position: SeatPositionEnum!
}

type Seat {
isOccupied: Boolean
height: Int @range(min: 0, max: 100)
instanceTag: SeatPosition
}

type Cabin {
seats: [Seat] @noDuplicates
doors: [Door] @noDuplicates
temperature: Float @range(min: -100, max: 100)
}
```

the following VSpec is exported:

```yaml
Cabin:
type: branch

Cabin.Door:
instances:
- [ROW1, ROW2]
- [DRIVERSIDE, PASSENGERSIDE]
type: branch

Cabin.Door.isLocked:
datatype: boolean
description: ''

Cabin.Door.position:
datatype: int32
description: ''
max: 100
min: 0

Cabin.Seat:
instances:
- [ROW1, ROW2, ROW3]
- [LEFT, CENTER, RIGHT]
type: branch

Cabin.Seat.height:
datatype: int32
description: ''
max: 100
min: 0

Cabin.Seat.isOccupied:
datatype: boolean
description: ''

Cabin.temperature:
datatype: float
description: ''
max: 100
min: -100

Vehicle:
type: branch

Vehicle.features:
datatype: string
description: ''

Vehicle.model:
datatype: string
description: ''

Vehicle.year:
datatype: int32
description: ''
```

It can be observed that the door property is attached to `Cabin` but not to `Vehicle`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.