Skip to content

Conversation

@ahmdmhd
Copy link
Collaborator

@ahmdmhd ahmdmhd commented Nov 12, 2025

This PR is based on #144 and implements #148.

The following commands:

  • compose
  • jsonschema
  • protobuf
  • shacl
  • vspec

now all accept the following flags:

  • --expanded-instances
  • --naming-config
  • --root-type
  • --schema
  • --selection-query

--naming-config has been moved from the export group and was added to all individual export commands.

The aforementioned commands now benefit from a unified schema processing logic through process_schema and load_and_process_schema; the GraphQL schema is processed before being passed to the command handlers.

Schema instances are expanded by the processors. This creates intermediate types that reflect the expansion. For example, this schema:

type Cabin {
  seats: [Seat] @noDuplicates
}

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

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

enum SeatRowEnum {
  ROW1
  ROW2
  ROW3
}

enum SeatPositionEnum {
  LEFT
  CENTER
  RIGHT
}

is expanded into:

type Cabin {
  Seat: Seat_Row!
}

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

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

enum SeatRowEnum {
  ROW1
  ROW2
  ROW3
}

enum SeatPositionEnum {
  LEFT
  CENTER
  RIGHT
}

type Seat_Position {
  LEFT: Seat
  CENTER: Seat
  RIGHT: Seat
}

type Seat_Row {
  ROW1: Seat_Position!
  ROW2: Seat_Position!
  ROW3: Seat_Position!
}

The expansion process changes how the JSON Schema and .proto files are created. However, the end result is functionally identical.

@ahmdmhd ahmdmhd force-pushed the refactor/unify-exporters-api branch from e025782 to ca5da8c Compare November 13, 2025 13:50
@ahmdmhd ahmdmhd requested a review from jdacoello November 24, 2025 19:53
@ahmdmhd ahmdmhd marked this pull request as ready for review November 24, 2025 19:53
@ahmdmhd ahmdmhd mentioned this pull request Nov 25, 2025
@ahmdmhd ahmdmhd force-pushed the refactor/unify-exporters-api branch from ba86a70 to 1223ae2 Compare November 26, 2025 13:15
@ahmdmhd ahmdmhd force-pushed the refactor/unify-exporters-api branch from 16d1b64 to 761817c Compare December 3, 2025 16:29
@ahmdmhd ahmdmhd mentioned this pull request Dec 4, 2025
@ahmdmhd ahmdmhd force-pushed the refactor/unify-exporters-api branch from 761817c to b7a475e Compare December 4, 2025 17:59
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
… to missing commands

Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
Signed-off-by: Ahmed Mohamed <ahmed.mohamed@motius.de>
@ahmdmhd ahmdmhd force-pushed the refactor/unify-exporters-api branch from 726a5d0 to 6910cb4 Compare December 8, 2025 14:02
@jdacoello jdacoello merged commit 98b62d3 into COVESA:main Dec 8, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants