openapi-directory icon indicating copy to clipboard operation
openapi-directory copied to clipboard

A few broken $ref s

Open hrennau opened this issue 3 years ago • 10 comments

In the OAS documents downloaded today (2021-03-09), a few references were observed:

Resource
azure.com:network-virtualNetwork.json
.  ./networkInterface.json#/definitions/NetworkInterfaceTapConfiguration
docusign.net.json
.  #/definitions/offlineAttributes
payrun.io.json
.  #/definitions/JournalExpressionDataTable
.  #/definitions/ThirdPartyTransaction
shutterstock.com.json
.  #/components/schemas/AssetId
.  #/components/schemas/AssetUploadId
squareup.com.json
.  #/components/schemas/invoice_delivery_methodInvoiceDeliveryMethod
statsocial.com.json
.  #/definitions/18_24
.  #/definitions/25_34
.  #/definitions/35_44

hrennau avatar Mar 09 '21 17:03 hrennau

Thanks for this! Can you let me know what tool you are using to validate the definitions?

DocuSign, PayRun, ShutterStock, SquareUp all should be fixed now.

The Azure one we know about (see issue #540)

StatSocial - can you check again, this one looks ok to me?

MikeRalphson avatar Mar 18 '21 08:03 MikeRalphson

Just checked StatSocial again, the version downloaded per REST service at 10AM CET. I see the following references:

#/definitions/18_24 #/definitions/25_34 #/definitions/35_44

But the schema names in "definitions" are: 1824 2534 3544

hrennau avatar Mar 18 '21 09:03 hrennau

Mike, could it be that the new versions are not yet delivered by the REST service? At any rate, I find the old ref errors, as well as a couple of new errors - see attachment. invalid-references.20210318.txt

hrennau avatar Mar 18 '21 10:03 hrennau

Yes, the CI run was probably still going when you checked. I'll have a look at your latest list. Thanks.

MikeRalphson avatar Mar 18 '21 13:03 MikeRalphson

Re: statsocial, I'm not sure what is eating the underscores, but here the definitions look like:

         description: "Possible reasons include:<br>{success: 0, msg: Error requesting twitter info, error_code_msg: API_TWITTER_ERROR}<br>{success: 0, msg: Error inserting new twitter report, error_code_msg: API_ERROR_CREATING_TWITTER_ACCOUNT}<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}"
          schema:
            $ref: "#/definitions/500_Error"
      summary: Used to create twitter follower report
      tags:
        - Follower Reports
definitions:
  18_24:
    properties:
      average:
        type: integer
      multiplicity:
        type: integer
      percentile:
        type: integer
      statistical_info:
        $ref: "#/definitions/statistical_info_18"

MikeRalphson avatar Mar 18 '21 13:03 MikeRalphson

Fixed the apigee.local/registry definition (same cause). The CI run will take at least 50 minutes from now.

MikeRalphson avatar Mar 18 '21 13:03 MikeRalphson

Will now travel a little and tonight will repeat the check and let you know.

hrennau avatar Mar 18 '21 17:03 hrennau

Good morning and good news, Mike - data almost clean now, excepting known issues (azure and statsocial).

azure.com_network-virtualNetworkTap.json
.  ./networkInterface.json#/definitions/NetworkInterfaceTapConfiguration
github.com.json
.  https://api.github.com/scim/v2/enterprises/octo-corp/Users/92b58aaa-a1d6-11ea-8227-b9ce9e023ccc (4)
.  https://api.github.com/scim/v2/enterprises/octo-corp/Users/aaaa8c34-a6b2-11ea-9d70-bbbbbd1c8fd5 (2)
statsocial.com.json
.  #/definitions/18_24
.  #/definitions/25_34
.  #/definitions/35_44

The github references are not new, I had just removed them by hand in previous reports, as I thought they are caused by shortcomings of my evaluator - but I'm not quite sure, therefore I now include them.

hrennau avatar Mar 19 '21 07:03 hrennau

PS: As you asked for the tool I use for checking - it is Foxpath, an expression language for evaluating resource trees and structured resource contents (XML, JSON, CSV, HTML). The reports I showed you were created by the following expression:

fox -D "../apis/*.json\jdescendant('$ref')[not(parent::properties)][not(jref(.))]\hlist-entry(bfname(), .) => hlist()"`

hrennau avatar Mar 19 '21 07:03 hrennau

I think the github.com ones you identified above are $ref values within examples. These are as-is key/value pairs in JSON/YAML example requests/responses are not actually $ref keywords which can be resolved.

statsocial.com looks fine for me.

azure.com is still pending a rearrangement of the service values / directory structure before these $refs can be fixed.

MikeRalphson avatar Jun 21 '21 06:06 MikeRalphson