Skip to content

Path of endpoint is not determined correctly when using OpenAPI file with {apiRoot} #172

@marsch-bsi

Description

@marsch-bsi

Describe the bug

Having some OpenAPI file with the following snippet of content:

openapi: 3.0.0

info:
  version: '1.4.0-alpha.3'
  title: 'NRF NFDiscovery Service'
  description: |
    NRF NFDiscovery Service.  
    © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).  
    All rights reserved.

externalDocs:
  description: 3GPP TS 29.510 V19.2.0; 5G System; Network Function Repository Services; Stage 3
  url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.510/'

servers:
  - url: '{apiRoot}/nnrf-disc/v1'
    variables:
      apiRoot:
        default: https://example.com
        description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501

and the following call of CATS:

cats -c=TS29510_Nnrf_NFDiscovery.yaml --server=http://127.0.0.10:7777 -b -k

I would assume that the resulting endpoint/Base path would be:

http://127.0.0.10:7777/nnrf-disc/v1

So basically {apiRoot} in the OpenAPI file is replaced with the provided --server argument, but this is actually not the case when checking the "Base path" or the curl command in the final report (index.html).

To Reproduce

Steps to reproduce the behaviour:

  1. Run cats -c=TS29510_Nnrf_NFDiscovery.yaml --server=http://127.0.0.10:7777/nnrf-disc/v1 -b -k
  2. Using OpenAPI spec from https://forge.3gpp.org/rep/all/5G_APIs with TS29510_Nnrf_NFDiscovery.yaml from here https://forge.3gpp.org/rep/all/5G_APIs/-/blob/REL-19/TS29510_Nnrf_NFDiscovery.yaml
  3. Open final report index.html and check "Base path" or curl command.

Expected behaviour

CATS building the correct path of endpoint when {apiRoot} is utilized in OpenAPI file.

Environment:

  • output of: cats info
Key Value
OS Name Linux
OS Version 6.8.0-60-generic
OS Arch amd64
Binary Type native
Cats Version 13.3.2
Cats Build 2025-06-25T20:58:36Z
Term Width 101
Term Type xterm-256color
Shell /bin/bash

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions