Open APIs

 View Only
  • 1.  Query on TMF 630 guideline – JSON-Patch+JSON vs JSON-Patch+query in OAS

    Posted Oct 07, 2025 05:58

    We are working on creating an OAS specification to support multiple content types as per the TMF 630 guidelines.

    In our scenario:

    • For application/json-patch+json, the request body is defined as an object.

    • For application/json-patch+query, the request body is defined as an array.

    However, current OpenAPI generators do not seem to support generating API interfaces with two different request body structures based on content type. They tend to default to the request body in first content type encountered.

    Has anyone else faced this issue? If so, could you suggest any possible solutions or workarounds (other than vendor extensions, which are causing issues with Swagger rendering)?



    ------------------------------
    prashanth kumaraswamy
    TO BE VERIFIED
    ------------------------------


  • 2.  RE: Query on TMF 630 guideline – JSON-Patch+JSON vs JSON-Patch+query in OAS

    TM Forum Member
    Posted Oct 07, 2025 09:28

    Hi Prashanth,

    This definitely doesn't work with the OAS currently generated by TM Forum. You will need to generate your own OAS.

    You would need to extend the RequestBody:

        GeographicAddress_FVO:
          description: The GeographicAddress to be created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeographicAddress_FVO'

    by something like

        GeographicAddress_FVO:
          description: The GeographicAddress to be created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeographicAddress_FVO'

            application/json-patch+json:
              schema:
                $ref: '#/components/schemas/JsonPatch_FVO'       

            application/json-patch-query+json:
              schema:
                $ref: '#/components/schemas/JsonPatchQuery_FVO'

    Once this is added some code-generators (e.g. OpenAPI generator for java/spring) will generate code with proper content negotiation.

    Your mileage might vary with other generators.

    Regards



    ------------------------------
    Koen Peeters
    Ciminko SA
    ------------------------------



  • 3.  RE: Query on TMF 630 guideline – JSON-Patch+JSON vs JSON-Patch+query in OAS

    Posted Oct 08, 2025 02:27

    Hi @Koen Peeters 

    Thank you for your response. We tried the approach suggested in your earlier comment. However, the Maven OpenAPI generator plugin consistently takes GeographicAddress_FVO as the request body for all content types, instead of mapping JsonPatch_FVO to application/json-patch+json and application/json-patch-query+json. We are trying to clarify whether this behavior is a limitation of the OpenAPI Specification itself, or an issue with the OpenAPI generator.

    Thanks 
    Prashanth 



    ------------------------------
    prashanth kumaraswamy
    TO BE VERIFIED
    ------------------------------