-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Description
Description
I was exploring ways of generating types from the existing api/swagger.yaml definition to explore alternative to the dockerode project (JS client for the Engine api) using the swagger as the single source of truth and swagger-typescript-api.
However I faced some some unfortunate results as some definitions are not specifying required properties, and by default it will be seen as optional. For example the ContainerSummary schema does not specify required field, therefore this is pretty difficult to determine what is mandatory and what is optional.
Some properties are specifying the x-nullable for example
Lines 5428 to 5430 in 70aa2e2
| ImageManifestDescriptor: | |
| $ref: "#/definitions/OCIDescriptor" | |
| x-nullable: true |
From my understanding, this only mean that this may be null, not that the property is sure to be in the object.
Reproduce
N/A
Expected behavior
I would expect to see the required property to specify mandatory properties.
docker version
N/Adocker info
N/AAdditional Info
Made a quick script to find all definitions of type object without a required property
119/146 object without required:
- MountPoint
- DeviceMapping
- DeviceRequest
- ThrottleDevice
- Mount
- RestartPolicy
- Resources
- Limit
- ResourceObject
- HealthConfig
- Health
- HealthcheckResult
- ContainerConfig
- ImageConfig
- NetworkingConfig
- NetworkSettings
- Address
- PortMap
- PortBinding
- Storage
- RootFSStorage
- RootFSStorageSnapshot
- ImageInspect
- ImagesDiskUsage
- AuthConfig
- ProcessConfig
- VolumesDiskUsage
- VolumeCreateRequest
- VolumeListResponse
- Network
- NetworkSummary
- NetworkInspect
- NetworkStatus
- ServiceInfo
- NetworkTaskInfo
- ConfigReference
- IPAM
- IPAMConfig
- IPAMStatus
- SubnetStatus
- EndpointResource
- PeerInfo
- BuildInfo
- BuildCache
- BuildCacheDiskUsage
- ImageID
- CreateImageInfo
- PushImageInfo
- DeviceInfo
- ErrorDetail
- ProgressDetail
- EndpointSettings
- EndpointIPAMConfig
- PluginPrivilege
- ObjectVersion
- NodeSpec
- Node
- NodeDescription
- Platform
- EngineDescription
- TLSInfo
- NodeStatus
- ManagerStatus
- SwarmSpec
- ClusterInfo
- JoinTokens
- Swarm
- TaskSpec
- ContainerStatus
- PortStatus
- TaskStatus
- Task
- ServiceSpec
- EndpointPortConfig
- EndpointSpec
- Service
- ImageDeleteResponseItem
- ServiceCreateResponse
- ServiceUpdateResponse
- ContainerInspectResponse
- ContainerSummary
- ContainersDiskUsage
- SecretSpec
- Secret
- ConfigSpec
- Config
- ContainerState
- ContainerUpdateResponse
- ContainerStatsResponse
- ContainerBlkioStats
- ContainerBlkioStatEntry
- ContainerCPUStats
- ContainerCPUUsage
- ContainerPidsStats
- ContainerThrottlingData
- ContainerMemoryStats
- ContainerNetworkStats
- ContainerStorageStats
- ContainerTopResponse
- ContainerWaitExitError
- SystemVersion
- SystemInfo
- ContainerdInfo
- FirewallInfo
- PluginsInfo
- RegistryServiceConfig
- IndexInfo
- Runtime
- Commit
- SwarmInfo
- PeerNode
- NetworkAttachmentConfig
- EventActor
- EventMessage
- OCIDescriptor
- OCIPlatform
- ClusterVolume
- ClusterVolumeSpec
- Topology