I am looking to store Kubernetes YAML/JSONs in dgraph. The issue is sometimes fields with same name (predicate in dgraph) have int or string data. Example:
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
ports:
- protocol: TCP
port: 80
targetPort: 9376
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
ports:
- protocol: TCP
port: 443
targetPort: https
In Kubernetes, which uses openapi v3, this field will defined using anyOf
.
targetPort:
anyOf:
- type: integer
- type: string
description: Name or number of the port to access on
the container. Number must be in the range 1 to 65535.
Name must be an IANA_SVC_NAME.
x-kubernetes-int-or-string: true
Will it be possible to store this types of JSONs in dgraph?