Skip to content

Commit

Permalink
fix: OpenApi Parser v2 Conform to legacy ids for snippet matching (#2176
Browse files Browse the repository at this point in the history
)
  • Loading branch information
RohinBhargava authored Feb 17, 2025
1 parent c4c2988 commit 63af2d9
Show file tree
Hide file tree
Showing 27 changed files with 130 additions and 123 deletions.
2 changes: 1 addition & 1 deletion packages/parsers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fern-api/docs-parsers",
"version": "0.0.58",
"version": "0.0.59",
"repository": {
"type": "git",
"url": "https://github.com/fern-api/fern-platform.git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("OAuth2SecuritySchemeConverterNode", () => {
type: "clientCredentials",
value: {
type: "referencedEndpoint",
endpointId: "endpoint_.postHttpsApiExampleComOauthToken",
endpointId: "endpoint_.post-https-api-example-com-oauth-token",
accessTokenLocator: "$.access_token",
headerName: "Authorization",
tokenPrefix: "Bearer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describe("SecuritySchemeConverterNode", () => {
type: "clientCredentials",
value: {
type: "referencedEndpoint",
endpointId: "endpoint_.postHttpsApiExampleComOauthToken",
endpointId: "endpoint_.post-https-api-example-com-oauth-token",
accessTokenLocator: "$.body.access_token",
headerName: "Authorization",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("OperationObjectConverterNode", () => {
},
},
],
id: "endpoint_.getPetsPetId",
id: "endpoint_.get-pets-pet-id",
method: "GET",
namespace: undefined,
operationId: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe("PathItemObjectConverterNode", () => {
responseStatusCode: 200,
},
],
id: "endpoint_.getPetsPetId",
id: "endpoint_.get-pets-pet-id",
method: "GET",
namespace: undefined,
operationId: undefined,
Expand Down Expand Up @@ -135,7 +135,7 @@ describe("PathItemObjectConverterNode", () => {
});
expect(result?.[1]).toMatchObject({
description: "Create a pet",
id: "endpoint_.postPetsPetId",
id: "endpoint_.post-pets-pet-id",
method: "POST",
path: [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "test-uuid-replacement",
"endpoints": {
"endpoint_.getVndFernUserJsonVersion1": {
"id": "endpoint_.getVndFernUserJsonVersion1",
"endpoint_.get-vnd-fern-user-json-version-1": {
"id": "endpoint_.get-vnd-fern-user-json-version-1",
"method": "GET",
"path": [
{
Expand Down Expand Up @@ -46,8 +46,8 @@
"type": "rest"
}
},
"endpoint_.getApplicationJson": {
"id": "endpoint_.getApplicationJson",
"endpoint_.get-application-json": {
"id": "endpoint_.get-application-json",
"method": "GET",
"path": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "test-uuid-replacement",
"endpoints": {
"endpoint_.getCollectionIdActiveIdDeprecatedRefIdXFernAvailabilityPathParam": {
"id": "endpoint_.getCollectionIdActiveIdDeprecatedRefIdXFernAvailabilityPathParam",
"endpoint_.get-collection-id-active-id-deprecated-ref-id-x-fern-availability-path-param": {
"id": "endpoint_.get-collection-id-active-id-deprecated-ref-id-x-fern-availability-path-param",
"method": "GET",
"path": [
{
Expand Down Expand Up @@ -280,8 +280,8 @@
"type": "rest"
}
},
"endpoint_.postSuccessRef": {
"id": "endpoint_.postSuccessRef",
"endpoint_.post-success-ref": {
"id": "endpoint_.post-success-ref",
"method": "POST",
"path": [
{
Expand Down Expand Up @@ -342,8 +342,8 @@
"type": "rest"
}
},
"endpoint_.postSuccessInlinePropertyDeprecation": {
"id": "endpoint_.postSuccessInlinePropertyDeprecation",
"endpoint_.post-success-inline-property-deprecation": {
"id": "endpoint_.post-success-inline-property-deprecation",
"method": "POST",
"path": [
{
Expand Down Expand Up @@ -440,8 +440,8 @@
"type": "rest"
}
},
"endpoint_.postSuccessInlineObjectDeprecation": {
"id": "endpoint_.postSuccessInlineObjectDeprecation",
"endpoint_.post-success-inline-object-deprecation": {
"id": "endpoint_.post-success-inline-object-deprecation",
"availability": "Deprecated",
"method": "POST",
"path": [
Expand Down Expand Up @@ -514,8 +514,8 @@
"type": "rest"
}
},
"endpoint_.postSuccessInlineBetaBody": {
"id": "endpoint_.postSuccessInlineBetaBody",
"endpoint_.post-success-inline-beta-body": {
"id": "endpoint_.post-success-inline-beta-body",
"availability": "Beta",
"method": "POST",
"path": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19692,8 +19692,8 @@
"type": "rest"
}
},
"endpoint_datasets.getUsage": {
"id": "endpoint_datasets.getUsage",
"endpoint_datasets.get-usage": {
"id": "endpoint_datasets.get-usage",
"description": "View the dataset storage usage for your Organization. Each Organization can have up to 10GB of storage across all their users.",
"namespace": [
"datasets"
Expand Down Expand Up @@ -27139,8 +27139,8 @@
"type": "rest"
}
},
"endpoint_connectors.oAuthAuthorize": {
"id": "endpoint_connectors.oAuthAuthorize",
"endpoint_connectors.o-auth-authorize": {
"id": "endpoint_connectors.o-auth-authorize",
"description": "Authorize the connector with the given ID for the connector oauth app. See ['Connector Authentication'](https://docs.cohere.com/docs/connector-authentication) for more information.",
"namespace": [
"connectors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "test-uuid-replacement",
"endpoints": {
"endpoint_.postTest": {
"id": "endpoint_.postTest",
"endpoint_.post-test": {
"id": "endpoint_.post-test",
"description": "Test multipart request with different content types.\n",
"displayName": "Test upload",
"method": "POST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
"type": "rest"
}
},
"endpoint_textToSpeech.generateFromPrompt": {
"id": "endpoint_textToSpeech.generateFromPrompt",
"endpoint_textToSpeech.generate-from-prompt": {
"id": "endpoint_textToSpeech.generate-from-prompt",
"description": "If you prefer to manage voices on your own, you can use your own audio file as a reference for the voice clone.x",
"namespace": [
"textToSpeech"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "test-uuid-replacement",
"endpoints": {
"endpoint_.getTest": {
"id": "endpoint_.getTest",
"endpoint_.get-test": {
"id": "endpoint_.get-test",
"method": "GET",
"path": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "test-uuid-replacement",
"endpoints": {
"endpoint_.getExample": {
"id": "endpoint_.getExample",
"endpoint_.get-example": {
"id": "endpoint_.get-example",
"displayName": "Get Example",
"method": "GET",
"path": [
Expand Down
28 changes: 14 additions & 14 deletions packages/parsers/src/openapi/__test__/__snapshots__/examples.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "test-uuid-replacement",
"endpoints": {
"endpoint_.postMatchingExamples": {
"id": "endpoint_.postMatchingExamples",
"endpoint_.post-matching-examples": {
"id": "endpoint_.post-matching-examples",
"method": "POST",
"path": [
{
Expand Down Expand Up @@ -103,8 +103,8 @@
"type": "rest"
}
},
"endpoint_.postNonMatchingExamples": {
"id": "endpoint_.postNonMatchingExamples",
"endpoint_.post-non-matching-examples": {
"id": "endpoint_.post-non-matching-examples",
"method": "POST",
"path": [
{
Expand Down Expand Up @@ -205,8 +205,8 @@
"type": "rest"
}
},
"endpoint_.postMoreRequests": {
"id": "endpoint_.postMoreRequests",
"endpoint_.post-more-requests": {
"id": "endpoint_.post-more-requests",
"method": "POST",
"path": [
{
Expand Down Expand Up @@ -307,8 +307,8 @@
"type": "rest"
}
},
"endpoint_.postMoreResponses": {
"id": "endpoint_.postMoreResponses",
"endpoint_.post-more-responses": {
"id": "endpoint_.post-more-responses",
"method": "POST",
"path": [
{
Expand Down Expand Up @@ -409,8 +409,8 @@
"type": "rest"
}
},
"endpoint_.postPostEmptyResponse": {
"id": "endpoint_.postPostEmptyResponse",
"endpoint_.post-post-empty-response": {
"id": "endpoint_.post-post-empty-response",
"description": "empty response",
"method": "POST",
"path": [
Expand Down Expand Up @@ -464,8 +464,8 @@
"type": "rest"
}
},
"endpoint_.postSingleExample": {
"id": "endpoint_.postSingleExample",
"endpoint_.post-single-example": {
"id": "endpoint_.post-single-example",
"method": "POST",
"path": [
{
Expand Down Expand Up @@ -548,8 +548,8 @@
"type": "rest"
}
},
"endpoint_.postRequestBodyReference": {
"id": "endpoint_.postRequestBodyReference",
"endpoint_.post-request-body-reference": {
"id": "endpoint_.post-request-body-reference",
"method": "POST",
"path": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "test-uuid-replacement",
"endpoints": {
"endpoint_.getExample": {
"id": "endpoint_.getExample",
"endpoint_.get-example": {
"id": "endpoint_.get-example",
"displayName": "Get Example",
"method": "GET",
"path": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "test-uuid-replacement",
"endpoints": {
"endpoint_.getUsers": {
"id": "endpoint_.getUsers",
"endpoint_.get-users": {
"id": "endpoint_.get-users",
"description": "List information about all users",
"displayName": "List Users",
"method": "GET",
Expand Down Expand Up @@ -56,8 +56,8 @@
"type": "rest"
}
},
"endpoint_.getUsersUserId": {
"id": "endpoint_.getUsersUserId",
"endpoint_.get-users-user-id": {
"id": "endpoint_.get-users-user-id",
"description": "Retrieve detailed information about a specific user",
"displayName": "Get user information",
"method": "GET",
Expand Down Expand Up @@ -136,8 +136,8 @@
"type": "rest"
}
},
"endpoint_.getToken": {
"id": "endpoint_.getToken",
"endpoint_.get-token": {
"id": "endpoint_.get-token",
"description": "Retrieve an authentication token for the API",
"displayName": "Get authentication token",
"method": "GET",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "test-uuid-replacement",
"endpoints": {
"endpoint_.postTestNestedArrayObject": {
"id": "endpoint_.postTestNestedArrayObject",
"endpoint_.post-test-nested-array-object": {
"id": "endpoint_.post-test-nested-array-object",
"method": "POST",
"path": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "test-uuid-replacement",
"endpoints": {
"endpoint_.patchSettings": {
"id": "endpoint_.patchSettings",
"endpoint_.patch-settings": {
"id": "endpoint_.patch-settings",
"method": "PATCH",
"path": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "test-uuid-replacement",
"endpoints": {
"endpoint_.postUsers": {
"id": "endpoint_.postUsers",
"endpoint_.post-users": {
"id": "endpoint_.post-users",
"displayName": "Create a user",
"method": "POST",
"path": [
Expand Down Expand Up @@ -83,8 +83,8 @@
"type": "rest"
}
},
"endpoint_.putUsers": {
"id": "endpoint_.putUsers",
"endpoint_.put-users": {
"id": "endpoint_.put-users",
"displayName": "Update a user",
"method": "PUT",
"path": [
Expand Down Expand Up @@ -165,8 +165,8 @@
"type": "rest"
}
},
"endpoint_.getUsersUserId": {
"id": "endpoint_.getUsersUserId",
"endpoint_.get-users-user-id": {
"id": "endpoint_.get-users-user-id",
"displayName": "Get a user",
"method": "GET",
"path": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "test-uuid-replacement",
"endpoints": {
"endpoint_auth.getToken": {
"id": "endpoint_auth.getToken",
"endpoint_auth.get-token": {
"id": "endpoint_auth.get-token",
"description": "Exchange credentials or refresh token for an access token",
"namespace": [
"auth"
Expand Down
Loading

0 comments on commit 63af2d9

Please sign in to comment.