Skip to content

Commit

Permalink
(fix): OpenAPI importer reads deprecated: true on operation objects (
Browse files Browse the repository at this point in the history
…#3129)

* (fix): openapi importer reads the deprecated property

* (fix): read deprecated: true from openapi

* fix ete test snapshots
  • Loading branch information
dsinghvi authored Mar 8, 2024
1 parent 77d0ab1 commit 9d11988
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -771,4 +771,4 @@ exports[`dependencies correctly incorporates dependencies 1`] = `
}"
`;

exports[`dependencies file dependencies 1`] = `1412752`;
exports[`dependencies file dependencies 1`] = `1412859`;
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ exports[`open api parser hathora simple 1`] = `
"endpoints": {
"CreatePrivateLobbyDeprecated": {
"auth": true,
"availability": "deprecated",
"docs": undefined,
"errors": [
"root.UnauthorizedError",
Expand Down Expand Up @@ -804,6 +805,7 @@ exports[`open api parser hathora simple 1`] = `
},
"CreatePublicLobbyDeprecated": {
"auth": true,
"availability": "deprecated",
"docs": undefined,
"errors": [
"root.UnauthorizedError",
Expand Down Expand Up @@ -850,6 +852,7 @@ exports[`open api parser hathora simple 1`] = `
},
"ListActivePublicLobbiesDeprecated": {
"auth": true,
"availability": "deprecated",
"docs": undefined,
"errors": [
"root.UnauthorizedError",
Expand Down Expand Up @@ -999,6 +1002,7 @@ exports[`open api parser hathora simple 1`] = `
},
"CreateLocalLobby": {
"auth": true,
"availability": "deprecated",
"docs": undefined,
"errors": [
"root.UnauthorizedError",
Expand Down Expand Up @@ -1072,6 +1076,7 @@ exports[`open api parser hathora simple 1`] = `
},
"CreatePrivateLobby": {
"auth": true,
"availability": "deprecated",
"docs": undefined,
"errors": [
"root.UnauthorizedError",
Expand Down Expand Up @@ -1145,6 +1150,7 @@ exports[`open api parser hathora simple 1`] = `
},
"CreatePublicLobby": {
"auth": true,
"availability": "deprecated",
"docs": undefined,
"errors": [
"root.UnauthorizedError",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2468,6 +2468,7 @@ The client secret is auto generated on the server and returned. The client does
},
"getAssetContent": {
"auth": true,
"availability": "deprecated",
"display-name": "Get the asset content.",
"docs": undefined,
"method": "GET",
Expand Down Expand Up @@ -4555,6 +4556,7 @@ The client secret is auto generated on the server and returned. The client does
},
"getContentVersion": {
"auth": true,
"availability": "deprecated",
"display-name": "Get a content by version.",
"docs": "You can read the generated documentation for your app at /api/content/{appName}/docs.",
"method": "GET",
Expand Down Expand Up @@ -5198,6 +5200,7 @@ The client secret is auto generated on the server and returned. The client does
},
"postContents": {
"auth": true,
"availability": "deprecated",
"display-name": "Import content items.",
"docs": "You can read the generated documentation for your app at /api/content/{appName}/docs.",
"errors": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2845,7 +2845,7 @@ exports[`open api parser hathora parse open api 1`] = `
{
"audiences": [],
"authed": true,
"availability": null,
"availability": "Deprecated",
"description": null,
"errorStatusCode": [
401,
Expand Down Expand Up @@ -3003,7 +3003,7 @@ exports[`open api parser hathora parse open api 1`] = `
{
"audiences": [],
"authed": true,
"availability": null,
"availability": "Deprecated",
"description": null,
"errorStatusCode": [
401,
Expand Down Expand Up @@ -3161,7 +3161,7 @@ exports[`open api parser hathora parse open api 1`] = `
{
"audiences": [],
"authed": true,
"availability": null,
"availability": "Deprecated",
"description": null,
"errorStatusCode": [
401,
Expand Down Expand Up @@ -3427,7 +3427,7 @@ exports[`open api parser hathora parse open api 1`] = `
{
"audiences": [],
"authed": true,
"availability": null,
"availability": "Deprecated",
"description": null,
"errorStatusCode": [
401,
Expand Down Expand Up @@ -3732,7 +3732,7 @@ exports[`open api parser hathora parse open api 1`] = `
{
"audiences": [],
"authed": true,
"availability": null,
"availability": "Deprecated",
"description": null,
"errorStatusCode": [
401,
Expand Down Expand Up @@ -4037,7 +4037,7 @@ exports[`open api parser hathora parse open api 1`] = `
{
"audiences": [],
"authed": true,
"availability": null,
"availability": "Deprecated",
"description": null,
"errorStatusCode": [
401,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25623,7 +25623,7 @@ You will be assigned as owner of the new team automatically.",
{
"audiences": [],
"authed": true,
"availability": null,
"availability": "Deprecated",
"description": "You can read the generated documentation for your app at /api/content/{appName}/docs.",
"errorStatusCode": [],
"examples": [],
Expand Down Expand Up @@ -25723,7 +25723,7 @@ You will be assigned as owner of the new team automatically.",
{
"audiences": [],
"authed": true,
"availability": null,
"availability": "Deprecated",
"description": "You can read the generated documentation for your app at /api/content/{appName}/docs.",
"errorStatusCode": [
400,
Expand Down Expand Up @@ -30195,7 +30195,7 @@ You will be assigned as owner of the new team automatically.",
{
"audiences": [],
"authed": true,
"availability": null,
"availability": "Deprecated",
"description": null,
"errorStatusCode": [],
"examples": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7489,7 +7489,7 @@ If the email or phoneNumber is set to null the previous value will be deleted. I
{
"audiences": [],
"authed": false,
"availability": null,
"availability": "Deprecated",
"description": "User Pagination API
",
"errorStatusCode": [
Expand Down Expand Up @@ -8135,7 +8135,7 @@ If the email or phoneNumber is set to null the previous value will be deleted. I
{
"audiences": [],
"authed": false,
"availability": null,
"availability": "Deprecated",
"description": "Get number of users
",
"errorStatusCode": [
Expand Down Expand Up @@ -9710,7 +9710,7 @@ Note that there is an invisible character at the end of the path, this was to av
{
"audiences": [],
"authed": false,
"availability": null,
"availability": "Deprecated",
"description": "Get User Pagination data.
Note that there is an invisible character at the end of the path, this was to avoid a conflict with the OpenAPI spec.
",
Expand Down Expand Up @@ -10067,7 +10067,7 @@ Note that there is an invisible character at the end of the path, this was to av
{
"audiences": [],
"authed": false,
"availability": null,
"availability": "Deprecated",
"description": "Get number of users.
Note that there is an invisible character at the end of the path, this was to avoid a conflict with the OpenAPI spec
",
Expand Down Expand Up @@ -17446,7 +17446,7 @@ e.g.:
{
"audiences": [],
"authed": false,
"availability": null,
"availability": "Deprecated",
"description": "Get session data
",
"errorStatusCode": [
Expand Down Expand Up @@ -18382,7 +18382,7 @@ e.g.:
{
"audiences": [],
"authed": false,
"availability": null,
"availability": "Deprecated",
"description": "Get JWT data for a session
",
"errorStatusCode": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ export function getFernAvailability(operationObject: OpenAPIV3.OperationObject):
} else if (availability === "deprecated") {
return EndpointAvailability.Deprecated;
}
if (operationObject.deprecated) {
return EndpointAvailability.Deprecated;
}
return undefined;
}

0 comments on commit 9d11988

Please sign in to comment.