Closed fbl100 closed 2 years ago
This error applies to initial_state values.
{
"type_id": "TLE",
"tle_line_1": "1 25544U 98067A 22230.54298192 .00005377 00000+0 10137-3 0 9995",
"tle_line_2": "2 25544 51.6425 27.6781 0005496 134.4097 303.3608 15.50216541354856"
}
CartesianOrbitStateSpec schema:
CartesianOrbitStateSpec:
title: CartesianOrbitStateSpec
description: |
CartesianOrbitStateSpec defines a set of state vectors that can
be used to initialize a propagator
allOf:
- $ref: '#/components/schemas/BaseOrbitStateSpec'
- type: object
properties:
type_id:
type: string
default: CARTESIAN
description: CARTESIAN
pos_km:
type: array
description: The position vector in the specified reference frame (km)
minItems: 3
maxItems: 3
items:
type: number
format: double
vel_km:
type: array
description: The velocity vector in the specified reference frame (km/sec)
minItems: 3
maxItems: 3
items:
type: number
format: double
required:
- type_id
BaseOrbitStateSpec:
title: BaseOrbitStateSpec
type: object
description: |
Defines common parameters for Cartesian and Keplerian orbits
properties:
epoch:
type: string
format: date-time
description: 'ISO 8601 Formatted Date (Zulu time zone only). If not specified, the simulation start time will be used'
reference_frame:
$ref: '#/components/schemas/ReferenceFrame'
ReferenceFrame:
type: string
title: ReferenceFrame
description: 'The reference frame of the attitude or orbital element. Assets should use J2000, Payloads should use SC_BODY (Spacecraft Body) NORAD TLE''s are typically specified in TEME (True Equator Mean Equinox)'
enum:
- J2000
- MOD
- TOD
- TEME
- ECEF
- SC_BODY
example: ECEF
Schema for TLEOrbitSpec
TLEOrbitSpec:
title: TLEOrbitSpec
type: object
properties:
type_id:
type: string
default: TLE
description: TLE
tle_line_1:
type: string
description: 'When specified, all orbit fields except Propagator must be blank'
tle_line_2:
type: string
description: 'When specified, all orbit fields except Propagator must be blank'
required:
- type_id
- tle_line_1
- tle_line_2
description: |
For use when defining an orbit using NORAD TLE's
The payload matches both schemas because in CartesianOrbitStateSpec all properties are optional except type_id and any properties are allowed in because additionalProperties is unset. This is the expected behavior. You can learn more about additionalProperties here.
To fix this you can:
Closing because this is a spec issue, not a generator issue
Bug Report Checklist
Description
python-experimental is failing to convert a json file to a model
Failure is here: python-experimental\python-client\openapi_client\schemas.py", line 1605, in __get_oneof_class raise ApiValueError( openapi_client.exceptions.ApiValueError: Invalid inputs given to generate an instance of <class 'openapi_client.model.orbit_state_spec.OrbitStateSpec'>. Multiple oneOf schemas [<class 'openapi_client.model.cartesian_orbit_state_spec.CartesianOrbitStateSpec'>, <class 'openapi_client.model.tle_orbit_spec.TLEOrbit Spec'>] matched the inputs, but a max of one is allowed.
openapi-generator version
latest (8/18/2022 snapshot build)
OpenAPI declaration file content or url
OpenAPI Spec: https://gist.github.com/fbl100/05a3b86fa93a8dec5912c679ce349500
python test:
Generation Details
generated client using docker image:
Steps to reproduce
generated client as above ran
pip install ./python-client
ran python test.pyRelated issues/PRs
Suggest a fix