Closed bodom0015 closed 8 months ago
As this API evolves, we will need to continue to add / adjust the client to handle new endpoints / models / properties etc
Fixes #71 Fixes #67 Fixes #79 Fixes #70
Relates to https://github.com/moleculemaker/mmli-backend/pull/29
openapi
src/app/api
app.module.ts
environment.service.ts
bypassSecurityTrustHtml
Molecule
Added some NPM directives to help us keep the client code in-sync
npm run openapi:sync
openapi.json
npm run openapi
npm run openapi:live
npm run openapi:sync:local
npm run openapi:live:local
Generating a client from Production API spec:
Generating a client from localdev API spec:
docker compose up -d --build
hostname=http://localhost:8080
assets/config/envvars.json
Flagging / Unflagging a Molecule:
Auto-Collapse Expanded Row when clicking "View Similar Structures":
Notify User about Active Ratelimit:
Thanks, Sara!
Problems
As this API evolves, we will need to continue to add / adjust the client to handle new endpoints / models / properties etc
Fixes #71 Fixes #67
Fixes #79 Fixes #70
Relates to https://github.com/moleculemaker/mmli-backend/pull/29
Approach
openapi
foldersrc/app/api
folderapp.module.ts
andenvironment.service.ts
, so that it can be used in AngularbypassSecurityTrustHtml
bit into a reusable Pipe - this allows us to use the generatedMolecule
modelAdded some NPM directives to help us keep the client code in-sync
npm run openapi:sync
: download and cache the latestopenapi.json
file from mmli-backend (prod)npm run openapi
: generate an API client from the cached specnpm run openapi:live
: does both of the abovenpm run openapi:sync:local
: download and cache the latestopenapi.json
file from mmli-backend (localhost)npm run openapi:live:local
: download the spec from localhost, and generate an API client from itHow to Test
Generating a client from Production API spec:
npm run openapi:sync
- this will download the latest spec from mmli-backend (prod)npm run openapi
- this will generate a new client from the latest specnpm run openapi:live
- this will download the latest spec, then generate a client from itGenerating a client from localdev API spec:
docker compose up -d --build
)hostname=http://localhost:8080
inassets/config/envvars.json
npm run openapi:live:local
to download the spec from your local mmli-backend and regenerate the clientnpm run openapi:live:local
Flagging / Unflagging a Molecule:
Auto-Collapse Expanded Row when clicking "View Similar Structures":
Notify User about Active Ratelimit: