jdegre/5GC_APIs

"event" example is missing in Nwdaf_EventsSubscription POST subscription method

kspviswa opened this issue · 2 comments

As per the schema, event of type string representing object NwdafEvent should be supplied. However the example in swagger doesn't contain event attribute.

Following is the copy/paste from example in swagger.

{
	"eventSubscriptions": [{
		"anySlice": true,
		"applicationIds": [
			"string"
		],
		"dnns": [
			"string"
		],
		"dnais": [
			"string"
		],
		"loadLevelThreshold": 0,
		"networkArea": {
			"ecgis": [{
				"plmnId": {
					"mcc": "string",
					"mnc": "string"
				},
				"eutraCellId": "string",
				"nid": "string"
			}],
			"ncgis": [{
				"plmnId": {
					"mcc": "string",
					"mnc": "string"
				},
				"nrCellId": "string",
				"nid": "string"
			}],
			"gRanNodeIds": [
				null,
				null,
				null,
				null
			],
			"tais": [{
				"plmnId": {
					"mcc": "string",
					"mnc": "string"
				},
				"tac": "string",
				"nid": "string"
			}]
		},
		"qosRequ": {
			"5qi": 0,
			"pdb": 0,
			"per": "string"
		},
		"qosFlowRetainThresholds": [
			0
		],
		"ranUeThroughputThresholds": [
			0
		],
		"repetitionPeriod": 0,
		"snssaia": [{
			"sst": 0,
			"sd": "string"
		}],
		"maxAnaEntry": 0,
		"tgtUe": {
			"anyUe": true,
			"supi": "string",
			"intGroupId": "string"
		},
		"congThresholds": [
			0
		]
	}],
	"evtReq": {
		"startTs": "2020-02-12T20:42:49.980Z",
		"endTs": "2020-02-12T20:42:49.980Z"
	},
	"notificationURI": "string",
	"supportedFeatures": "string"
}

@kspviswa, it seems that the reason is that the Swagger Editor does not process correctly the type definition NwdafEvent. This type is meant to be an extensible enum (an enum with an open set of values, to prevent backwards incompatibilities when new values are added in future API versions), and it is defined as:

    NwdafEvent:
      anyOf:
      - type: string
        enum:
          - SLICE_LOAD_LEVEL
          - SERVICE_EXPERIENCE
          - QOS_SUSTAINABILITY
          - ABNORMAL_BEHAVIOUR
          - USER_DATA_CONGESTION
      - type: string

If you change the definition and use a "regular" enum instead, the event attribute shows up in the example window, as expected.

I really cannot provide more info as to why Swagger Editor behaves like that for such type definition.

Thanks for the explanation. Let me close this issue.