openapi: 3.0.0

info:
  title: 3gpp-vfl-nf-discovery
  version: 1.0.0
  description: |
    API for VFL NF Discovery.  
    © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).  
    All rights reserved.

externalDocs:
  description: >
    3GPP TS 29.522 V19.5.0; 5G System; Network Exposure Function Northbound APIs.
  url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/'

servers:
  - url: '{apiRoot}/3gpp-vfl-nf-discovery/v1'
    variables:
      apiRoot:
        default: https://example.com
        description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122

security:
  - {}
  - oAuth2ClientCredentials: []

paths:
  /discover-nwdaf:
    post:
      summary: Request of NWDAF(s) that are to act as VFL client(s).
      tags:
        - VFL NF discovery
      operationId: DiscoverNwdaf
      requestBody:
        description: Representation of the request of NWDAF that are to act as VFL client(s).
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NwdafDiscoveryRequest'
      responses:
        '200':
          description: >
            OK. Successful case. The external NWDAF ID is provisioned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NwdafDiscoveryResponse'
        '307':
          $ref: 'TS29122_CommonData.yaml#/components/responses/307'
        '308':
          $ref: 'TS29122_CommonData.yaml#/components/responses/308'
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29122_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29122_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29122_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'

  /release-nwdaf:
    post:
      summary: Request to inform the external NWDAF ID(s) are not used anymore.
      operationId: ReleaseNwdaf
      tags:
        - VFL NF discovery release
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NwdafReleaseRequest'
      responses:
        '204':
          description: No Content. Successful case.
        '307':
          $ref: 'TS29122_CommonData.yaml#/components/responses/307'
        '308':
          $ref: 'TS29122_CommonData.yaml#/components/responses/308'
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29122_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29122_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29122_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'

components:
  securitySchemes:
    oAuth2ClientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: '{tokenUrl}'
          scopes: {}

  schemas: 
    NwdafDiscoveryRequest:
      description: >
        Represents the parameters to request the NWDAF(s) that are to act as VFL client(s).
      type: object
      properties:
        analyticIds:
          type: array
          items:
            $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent'
          minItems: 1
        vflCapType:
          $ref: '#/components/schemas/VFLCapabilityType'
        vflInterInfo:
          type: string
          description: String representing the VFL Interoperability Information.
        reqFeatureIds:
          type: array
          items:
            type: string
          minItems: 1
        timePeriod:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow'
        serviceAreas:
          type: array
          items:
            $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea'
          minItems: 1
      required:
        - analyticIds
        - vflCapType

    NwdafDiscoveryResponse:
      description: >
        Represents the external NWDAF ID(s) to act as the VFL client(s).
      type: object
      properties:
        exNwdafIds:
          type: array
          items:
            type: string
          description: The current external NWDAF identifier.
          minItems: 1
      required:
        - exNwdafIds

    NwdafReleaseRequest:
      description: >
        Represents the parameters to inform the external NWDAF ID(s) are not used anymore.
      type: object
      properties:
        exNwdafIds:
          type: array
          items:
            type: string
          description: The current external NWDAF identifier.
          minItems: 1
      required:
        - exNwdafIds

#
# SIMPLE DATA TYPES
#

#
# ENUMERATIONS
#

    VFLCapabilityType:
      anyOf:
      - type: string
        enum:
          - VFL_CLIENT
      - type: string
        description: Represents the VFL capability type to be discovered.
      description: |
        Represents the VFL capability type to be discovered.  
        Possible values are:
          - VFL_CLIENT: Represents the VFL capability type to be discovered is VFL client.
