Comments (19)
Here is the swagger definiton
{
"swagger": "2.0",
"host": "localhost:8080",
"paths": {
"/account/getme": {
"get": {
"description": "Get the account profile of currently logged in user.",
"produces": ["application/json"],
"tags": ["Account"],
"summary": "Get Self Account",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/types_GetSelfAccountResponse"
}
}
}
}
}
}
},
"definitions": {
"types_GetSelfAccountResponse": {
"type": "object",
"properties": {
"aid": {
"description": "Account ID",
"type": "string"
},
"created_at": {
"description": "unix time of when the account was created",
"type": "integer"
},
"profile": {
"$ref": "#/definitions/types_UserProfile"
},
"uid": {
"description": "User ID from supertokens",
"type": "string"
},
"updated_time": {
"description": "unix time of when the profile was last updated",
"type": "integer"
}
}
},
"types_UserProfile": {
"type": "object",
"properties": {
"bio": {
"description": "bio of this account.",
"type": "string"
},
"display_name": {
"description": "the display name associated with this account.",
"type": "string"
},
"gender": {
"description": "Gender of the user. One of m(male), f(female), o(other), n(not specified)",
"type": "string"
},
"location": {
"description": "The location set by the user.",
"type": "string"
},
"memorial": {
"description": "is this account a memorial account? Has the owner of this account passed away?",
"type": "boolean"
},
"pid": {
"description": "Profile ID",
"type": "string"
},
"username": {
"description": "Username associated with this account.",
"type": "string"
}
}
}
}
}
from wundergraph.
Hi @a0v0, you are using a very old version of wundergraph. Could you upgrade to the latest version and try again?
from wundergraph.
"@wundergraph/nextjs": "^0.3.15",
"@wundergraph/sdk": "^0.116.1",
"@wundergraph/swr": "^0.2.2",
from wundergraph.
Please be a bit more verbose π So you can still reproduce it?
from wundergraph.
Yes, still the same problem.
from wundergraph.
I
"@wundergraph/nextjs": "^0.3.15", "@wundergraph/sdk": "^0.116.1", "@wundergraph/swr": "^0.2.2",
@StarpTech is the version correct?
from wundergraph.
Yes, looks good. We'll investigate.
from wundergraph.
any luck on this one?
from wundergraph.
any luck on this one?
Hey, I'm sorry that it takes a while. My backlog is almost emptied. I'll look into this asap.
from wundergraph.
Still waiting...
from wundergraph.
@a0v0 It looks like something is wrong in your configuration. The swagger.json
file is missing an info
node and does not match the fields in SelfProfile.graphql
. Are you sure you're posting the correct one? Thanks!
from wundergraph.
@a0v0 It looks like something is wrong in your configuration. The
swagger.json
file is missing aninfo
node and does not match the fields inSelfProfile.graphql
. Are you sure you're posting the correct one? Thanks!
This is the full swagger,json
{
"swagger": "2.0",
"info": {
"description": "desc",
"title": "api",
"version": "1.0"
},
"host": "localhost:8080",
"paths": {
"/account/getme": {
"get": {
"description": "Get the account profile",
"produces": ["application/json"],
"tags": ["Account"],
"summary": "Get Self Account",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/account_GetSelfAccountSwaggerResponse"
}
}
}
}
}
},
"/account/updateme": {
"post": {
"description": "Update the account ",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["Account"],
"summary": "Update Self Account",
"parameters": [
{
"description": "body",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/types_UpdateSelfAccountRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/xerr_ResponseSuccessBean"
}
}
}
}
}
},
"/auth/session/refresh": {
"post": {
"description": "Refreshes",
"tags": ["Auth/Passwordless"],
"summary": "Refresh Session",
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/auth/signinup/code": {
"post": {
"description": "Send ",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["Auth/Passwordless"],
"summary": "Signup Code Request",
"parameters": [
{
"description": "email",
"name": "email",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/supertokens_SignupCodeRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/supertokens_SignupCodeRequestResponse"
}
}
}
}
}
},
"/auth/signinup/code/consume": {
"post": {
"description": "Consumes a signup code",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["Auth/Passwordless"],
"summary": "Signup Code Consume",
"parameters": [
{
"description": "body",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/supertokens_SignupCodeConsume"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/supertokens_SignupCodeConsumeResponse"
}
}
}
}
}
},
"/auth/signout": {
"post": {
"description": "Logout a.k.a revoke supertoken's passwordless session",
"tags": ["Auth/Passwordless"],
"summary": "Logout",
"responses": {
"200": {
"description": "OK"
}
}
}
}
},
"definitions": {
"account_GetSelfAccountSwaggerResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {
"$ref": "#/definitions/types_GetSelfAccountResponse"
},
"msg": {
"type": "string"
}
}
},
"supertokens_SignupCodeConsume": {
"type": "object",
"properties": {
"deviceId": {
"type": "string"
},
"flowType": {
"type": "string"
},
"preAuthSessionId": {
"type": "string"
},
"userInputCode": {
"type": "string"
}
}
},
"supertokens_SignupCodeConsumeResponse": {
"type": "object",
"properties": {
"createdNewUser": {
"type": "boolean"
},
"status": {
"type": "string"
},
"user": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"id": {
"type": "string"
},
"phoneNumber": {
"type": "string"
},
"timejoined": {
"type": "integer"
}
}
}
}
},
"supertokens_SignupCodeRequest": {
"type": "object",
"properties": {
"email": {
"type": "string"
}
}
},
"supertokens_SignupCodeRequestResponse": {
"type": "object",
"properties": {
"deviceId": {
"type": "string"
},
"flowType": {
"type": "string"
},
"preAuthSessionId": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"types_GetSelfAccountResponse": {
"type": "object",
"properties": {
"aid": {
"description": "Account ID",
"type": "string"
},
"created_at": {
"description": "unix time of when the account was created",
"type": "integer"
},
"profile": {
"$ref": "#/definitions/types_UserProfile"
},
"uid": {
"description": "User ID from supertokens",
"type": "string"
},
"updated_time": {
"description": "unix time of when the profile was last updated",
"type": "integer"
}
}
},
"types_UpdateSelfAccountRequest": {
"type": "object",
"required": ["display_name", "gender"],
"properties": {
"bio": {
"description": "bio of this account",
"type": "string",
"maxLength": 160
},
"display_name": {
"description": "Display name of the account_",
"type": "string",
"maxLength": 50,
"minLength": 2
},
"gender": {
"description": "Gender of the user",
"type": "string",
"enum": ["male", "female", "other"]
},
"location": {
"description": "Location of the account",
"type": "string",
"maxLength": 30
},
"memorial": {
"description": "is this account a memorial account? Has the owner of this account passed away?",
"type": "boolean"
}
}
},
"types_UserProfile": {
"type": "object",
"properties": {
"bio": {
"description": "bio of this account_",
"type": "string"
},
"display_name": {
"description": "the display name associated with this account_",
"type": "string"
},
"gender": {
"description": "Gender of the user. One of m(male), f(female), o(other), n(not specified)",
"type": "string"
},
"location": {
"description": "The location set by the user.",
"type": "string"
},
"memorial": {
"description": "is this account a memorial account? Has the owner of this account passed away?",
"type": "boolean"
},
"pid": {
"description": "Profile ID",
"type": "string"
},
"username": {
"description": "Username associated with this account_",
"type": "string"
}
}
},
"xerr_ResponseSuccessBean": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {},
"msg": {
"type": "string"
}
}
}
}
}
from wundergraph.
@a0v0 Thanks for the updated file. I'm looking into it.
from wundergraph.
@a0v0 I've reproduce the problem. I'll continue investigating.
from wundergraph.
@a0v0 I've reproduce the problem. I'll continue investigating.
ok waiting for a fix
from wundergraph.
@a0v0 Your swagger.json
declares that your top level item is an array, but it's actually an object. If you wrap the data your server returns in an array, it works. e.g.
[{"code":200,"msg":"OK","data":{"aid":"WQE8DKodOomqZ_HTNxaYo","uid":"631dd6c5-e4c3-4975-8ca3-61f026430ec5","profile":{"pid":"JG2OTM9yLIfzECINpcttW","username":"","display_name":"rtweπte","bio":"I am bio π","gender":"other","location":"s","memorial":false},"created_at":1666201846162,"updated_time":1666202011}}]
$ curl 'http://localhost:9991/fapi/main/operations/SelfProfile' (10-28 14:12)
{"data":{"fapi_getAccountGetme":[{"code":200,"msg":"OK","data":{"aid":"WQE8DKodOomqZ_HTNxaYo"}}]}}%
We'll add some checks to return an error in this case, but there's no actual bug.
from wundergraph.
"type": "array",
oh, this! I will try to fix and reply back
from wundergraph.
@a0v0 Your
swagger.json
declares that your top level item is an array, but it's actually an object. If you wrap the data your server returns in an array, it works. e.g.[{"code":200,"msg":"OK","data":{"aid":"WQE8DKodOomqZ_HTNxaYo","uid":"631dd6c5-e4c3-4975-8ca3-61f026430ec5","profile":{"pid":"JG2OTM9yLIfzECINpcttW","username":"","display_name":"rtweπte","bio":"I am bio π","gender":"other","location":"s","memorial":false},"created_at":1666201846162,"updated_time":1666202011}}]$ curl 'http://localhost:9991/fapi/main/operations/SelfProfile' (10-28 14:12) {"data":{"fapi_getAccountGetme":[{"code":200,"msg":"OK","data":{"aid":"WQE8DKodOomqZ_HTNxaYo"}}]}}%We'll add some checks to return an error in this case, but there's no actual bug.
Thanks. Changing return type to object fixed the problem. Closing the issue.
from wundergraph.
Thanks. Changing return type to object fixed the problem. Closing the issue.
You're welcome. Thanks for letting us know!
from wundergraph.
Related Issues (20)
- [Issue]: Not being able to send an array of strings for operations that requires them as query params HOT 2
- [Issue]: WG not sending query params when `statusCodeUnions` is `true` HOT 1
- 'SWRConfig' is not exported from '@wundergraph/swr' HOT 2
- [Issue]: mock server not working as expected HOT 2
- [Issue]: With openApiV2, BigInt cannot be serialized HOT 1
- [Issue]: Missing import sdk/server/fetch.ts HOT 4
- [Issue]: Scalar input fields on GraphQL datasource converted to strings HOT 12
- [Issue]: Live queries are not working when running server in debug mode (SvelteKit) HOT 2
- [Issue]: InputValidationError returns text/plain but should return application/json HOT 4
- [Issue]: Nextjs token based auth is not secure HOT 5
- Support for @tanstack/react-query v5 HOT 2
- Generated graphql Operations ignore the default values set in OAS Schema definition
- [Issue]: TestServer start timeout artificially limited to maximum of 60s HOT 1
- Object literal may only specify known properties, and 'type' does not exist in type 'JSONSchema7' HOT 5
- [Issue]: Nextjs App Router Migration Problem HOT 5
- introspect.graphql does not work for Contetnful GQL Schema HOT 3
- [Issue]: NextJS 14 failing to run useQuery calls that are Live Queries HOT 5
- Remove dependency on terminate package HOT 1
- [Issue]: Unable to get headers in revalidate hook HOT 1
- [Issue]: Crash in Subscriptions after publishing an event to NATS. HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wundergraph.