Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save florianmartens/e0a264062fea931b61c4a5640d53ef45 to your computer and use it in GitHub Desktop.
Save florianmartens/e0a264062fea931b61c4a5640d53ef45 to your computer and use it in GitHub Desktop.
swagger.json
{"openapi":"3.0.0","paths":{"/auth/signin":{"post":{"operationId":"signIn","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginDto"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/auth/google-auth":{"get":{"operationId":"googleSignIn","parameters":[],"responses":{"200":{"description":""}},"tags":["Auth"]}},"/auth/google-redirect":{"get":{"operationId":"googleRedirect","parameters":[],"responses":{"200":{"description":""}},"tags":["Auth"]}},"/auth/refresh":{"get":{"operationId":"refreshToken","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponseDto"}}}}},"tags":["Auth"],"security":[{"bearer":[]}]}},"/auth/confirm-email":{"get":{"operationId":"confirmEmailAddress","parameters":[{"name":"token","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEmailEntity"}}}}},"tags":["Auth"]}},"/auth/resend-confirm-email":{"post":{"operationId":"resendConfirmEmailAddress","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEmailEntity"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEmailEntity"}}}}},"tags":["Auth"]}},"/auth/password-reset":{"post":{"operationId":"resetPassword","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetDto"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/auth/send-password-reset-token":{"post":{"operationId":"sendPasswordResetToken","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEmailEntity"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/auth/signup":{"post":{"operationId":"createUser","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserDto"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/users/me":{"get":{"operationId":"getMe","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEntity"}}}}},"tags":["User"],"security":[{"bearer":[]}]},"patch":{"operationId":"updateMe","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEntity"}}}}},"tags":["User"],"security":[{"bearer":[]}]}},"/users/me/subscriptions/issues":{"get":{"operationId":"getSubscriptionIssues","parameters":[],"responses":{"200":{"description":""}},"tags":["User"],"security":[{"bearer":[]}]}},"/users/me/publications":{"get":{"operationId":"findPublicationsForUser","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PublicationEntity"}}}}}},"tags":["User"],"security":[{"bearer":[]}]}},"/users/{id}":{"get":{"operationId":"findUser","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnonymousUserEntity"}}}}},"tags":["User"]}},"/p/{pid}":{"get":{"operationId":"findPublication","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationEntity"}}}}},"tags":["Publication"],"security":[{"bearer":[]},{"bearer":[]}]},"put":{"operationId":"updatePublication","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePublicationDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationEntity"}}}}},"tags":["Publication"],"security":[{"bearer":[]}]},"delete":{"operationId":"removePublication","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Publication"],"security":[{"bearer":[]}]}},"/p":{"post":{"operationId":"createPublication","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicationDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationEntity"}}}}},"tags":["Publication"],"security":[{"bearer":[]}]}},"/o/p/search/{searchTerm}":{"get":{"operationId":"searchPublications","parameters":[{"name":"searchTerm","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PublicationEntity"}}}}}},"tags":["Public/Publication"]}},"/o/p/{pslug}":{"get":{"operationId":"findPublicPublication","parameters":[{"name":"pslug","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationEntity"}}}}},"tags":["Public/Publication"]}},"/p/{pid}/issues":{"get":{"operationId":"findAllIssuesForPublication","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}},{"name":"take","required":false,"in":"query","schema":{"type":"number"}},{"name":"skip","required":false,"in":"query","schema":{"type":"number"}},{"name":"orderBy","required":false,"in":"query","schema":{"type":"string"}},{"name":"orderMode","required":false,"in":"query","schema":{"enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IssueEntity"}}}}}},"tags":["Issues"],"security":[{"bearer":[]}]},"post":{"operationId":"createIssue","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateIssueDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueEntity"}}}}},"tags":["Issues"],"security":[{"bearer":[]}]}},"/p/{pid}/issues/{issueId}/autosave":{"put":{"operationId":"autoSaveIssue","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}},{"name":"issueId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutosaveIssueDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueEntity"}}}}},"tags":["Issues"],"security":[{"bearer":[]}]}},"/p/{pid}/issues/{id}":{"delete":{"operationId":"removeIssue","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Issues"],"security":[{"bearer":[]}]}},"/o/p/{pslug}/issues/first":{"get":{"operationId":"findFirstIssueForPublication","parameters":[{"name":"pslug","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Public/Issue"]}},"/o/p/{pslug}/issues/{slug}":{"get":{"operationId":"findIssueForPublication","parameters":[{"name":"pslug","required":true,"in":"path","schema":{"type":"string"}},{"name":"slug","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Public/Issue"]}},"/o/p/{pslug}/issues/next":{"get":{"operationId":"findNextIssueForPublication","parameters":[{"name":"pslug","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Public/Issue"]}},"/o/p/{pslug}/issues":{"get":{"operationId":"findIssuesForPublication","parameters":[{"name":"pslug","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Public/Issue"]}},"/p/{pid}/submissions":{"post":{"operationId":"createSubmission","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubmissionDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionEntity"}}}}},"tags":["Submissions"],"security":[{"bearer":[]}]}},"/p/{pid}/submissions/{submissionId}":{"put":{"operationId":"updateSubmission","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}},{"name":"submissionId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSubmissionDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionEntity"}}}}},"tags":["Submissions"],"security":[{"bearer":[]}]}},"/p/{pid}/issues/{issueId}/submissions":{"get":{"operationId":"findSubmissions","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}},{"name":"issueId","required":true,"in":"path","schema":{"type":"string"}},{"name":"take","required":true,"in":"query","schema":{"type":"number"}},{"name":"skip","required":true,"in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubmissionEntity"}}}}}},"tags":["Submissions"]}},"/p/{pid}/submissions/{id}":{"get":{"operationId":"findSubmission","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}},{"name":"submissionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionEntity"}}}}},"tags":["Submissions"],"security":[{"bearer":[]}]},"delete":{"operationId":"delete","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}},{"name":"submissionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Submissions"]}},"/p/{pid}/subscriptions":{"get":{"operationId":"findSubscriptionsForPublication","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}},{"name":"take","required":true,"in":"query","schema":{"type":"number"}},{"name":"skip","required":true,"in":"query","schema":{"type":"number"}},{"name":"search","required":true,"in":"query","schema":{"type":"string"}},{"name":"orderBy","required":true,"in":"query","schema":{"type":"string"}},{"name":"orderMode","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionEntity"}}}}}},"tags":["Subscriptions"],"security":[{"bearer":[]}]},"post":{"operationId":"createSubscription","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionEntity"}}}}},"tags":["Subscriptions"],"security":[{"bearer":[]}]}},"/p/{pid}/subscriptions/me":{"get":{"operationId":"findOwnSubscriptionForPublication","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionEntity"}}}}},"tags":["Subscriptions"],"security":[{"bearer":[]}]}},"/p/{pid}/subscriptions/annonymous":{"post":{"operationId":"createAnnonymousSubscription","parameters":[{"name":"pid","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAnnonymousSubscriptionDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionEntity"}}}}},"tags":["Subscriptions"]}},"/subscriptions/{id}":{"delete":{"operationId":"removeSubscription","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Subscriptions"],"security":[{"bearer":[]}]}}},"info":{"title":"Cats example","description":"NextLetter API description","version":"0.0.1","contact":{}},"tags":[{"name":"","description":""}],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"LoginDto":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}},"required":["username","password"]},"TokenResponseDto":{"type":"object","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["accessToken","refreshToken"]},"UserEmailEntity":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"]},"PasswordResetDto":{"type":"object","properties":{"newPassword":{"type":"string"},"token":{"type":"string"}},"required":["newPassword","token"]},"CreateUserDto":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"]},"ProfileEntity":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"address":{"type":"string"},"city":{"type":"string"},"countryCode":{"type":"string"},"phone":{"type":"string"},"twitterLink":{"type":"string"},"linkedInLink":{"type":"string"},"userId":{"type":"string"}},"required":["id","createdAt","updatedAt","userId"]},"UserEntity":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"},"isAdmin":{"type":"boolean"},"isActive":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"provider":{"type":"string","enum":["GOOGLE"]},"profile":{"$ref":"#/components/schemas/ProfileEntity"}},"required":["id","email","firstName","lastName","username","password","isAdmin","isActive","createdAt","updatedAt","profile"]},"UpdateUserDto":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"username":{"type":"string"}},"required":["lastName"]},"PublicationEntity":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"title":{"type":"string"},"description":{"type":"string"},"isPublic":{"type":"boolean"},"issueCount":{"type":"number"},"hasOpenSubmissions":{"type":"boolean"},"link":{"type":"string"},"organizationAddress":{"type":"string"},"organizationName":{"type":"string"},"slug":{"type":"string"},"subscriptionCount":{"type":"number"},"type":{"type":"string","enum":["LIST","NEWSLETTER"]}},"required":["id","createdAt","updatedAt","title","description","isPublic","issueCount","hasOpenSubmissions","link","organizationAddress","organizationName","slug","subscriptionCount","type"]},"AnnonymousUserEntity":{"type":"object","properties":{"id":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"username":{"type":"string"},"isAdmin":{"type":"boolean"},"isActive":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"provider":{"type":"string","enum":["GOOGLE"]},"profile":{"$ref":"#/components/schemas/ProfileEntity"}},"required":["id","firstName","lastName","username","isAdmin","isActive","createdAt","updatedAt","profile"]},"UpdatePublicationDto":{"type":"object","properties":{"title":{"type":"string"},"isPublic":{"type":"boolean"},"organizationName":{"type":"string"},"organizationAddress":{"type":"string"}}},"CreatePublicationDto":{"type":"object","properties":{"title":{"type":"string"},"isPublic":{"type":"boolean"},"organizationName":{"type":"string"},"organizationAddress":{"type":"string"}},"required":["title","isPublic","organizationName","organizationAddress"]},"IssueEntity":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"editorContent":{"type":"string"},"preview":{"type":"string"},"isPublished":{"type":"boolean"},"publicationId":{"type":"string"},"publishedAt":{"format":"date-time","type":"string"}},"required":["id","createdAt","updatedAt","slug","title","editorContent","preview","isPublished","publicationId","publishedAt"]},"CreateIssueDto":{"type":"object","properties":{"title":{"type":"string"},"publicationId":{"type":"string"}},"required":["title","publicationId"]},"AutosaveIssueDto":{"type":"object","properties":{"editorContent":{"type":"string"},"title":{"type":"string"}},"required":["editorContent","title"]},"CreateSubmissionDto":{"type":"object","properties":{"type":{"type":"object"},"description":{"type":"string"},"body":{"type":"string"},"title":{"type":"string"},"link":{"type":"string"},"isOwnerSubmission":{"type":"boolean"},"publicationId":{"type":"string"},"issueId":{"type":"string"}},"required":["type","description","body","title","link","isOwnerSubmission","publicationId","issueId"]},"SubmissionEntity":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publicationId":{"type":"string"},"title":{"type":"string"},"link":{"type":"string"},"type":{"type":"string","enum":["SOCIAL","EVENT","ARTICLE"]},"status":{"type":"string","enum":["SUBMITTED","STAGED","ACCEPTED","DISCARDED"]},"body":{"type":"string"},"description":{"type":"string"},"ownerId":{"type":"string"},"issueId":{"type":"string"},"submissionCategoryId":{"type":"string"}},"required":["id","createdAt","updatedAt","publicationId","title","link","type","status","body","description","ownerId","issueId","submissionCategoryId"]},"UpdateSubmissionDto":{"type":"object","properties":{"type":{"type":"object"},"description":{"type":"string"},"body":{"type":"string"},"title":{"type":"string"},"link":{"type":"string"},"status":{"type":"object"}},"required":["type","description","body","title","link","status"]},"SubscriptionEntity":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"userId":{"type":"string"},"publicationId":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","email","firstName","lastName","userId","publicationId","isActive","createdAt","updatedAt"]},"CreateAnnonymousSubscriptionDto":{"type":"object","properties":{"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"}},"required":["email","firstName","lastName"]}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment