-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
132 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
"@shopware/api-gen": minor | ||
--- | ||
|
||
Added `apiType` option in `loadSchema` command. With `SHOPWARE_ADMIN_USERNAME` and `SHOPWARE_ADMIN_PASSWORD` env variables we can now authorize Admin API schema. | ||
|
||
example: | ||
|
||
```bash | ||
# load schema from store API | ||
pnpx @shopware/api-gen loadSchema --apiType=store --filename=storeApiSchema.json | ||
|
||
# load schema from admin API | ||
pnpx @shopware/api-gen loadSchema --apiType=admin --filename=adminApiSchema.json | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,12 +19,18 @@ npx i @shopware/api-gen [command] | |
|
||
### `generate` | ||
|
||
Transform OpenAPI specification from JSON file to Typescript schemas. | ||
Transform OpenAPI specification from JSON file to Typescript schemas. Use `loadSchema` command first. | ||
|
||
options: | ||
|
||
```bash | ||
pnpx @shopware/api-gen generate --help | ||
|
||
# generate schemas from store API | ||
pnpx @shopware/api-gen generate --filename=storeApiSchema.json | ||
|
||
# generate schemas from admin API | ||
pnpx @shopware/api-gen generate --filename=adminApiSchema.json | ||
``` | ||
|
||
### `loadSchema` | ||
|
@@ -35,6 +41,21 @@ options: | |
|
||
```bash | ||
pnpx @shopware/api-gen loadSchema --help | ||
|
||
# load schema from store API | ||
pnpx @shopware/api-gen loadSchema --apiType=store --filename=storeApiSchema.json | ||
|
||
# load schema from admin API | ||
pnpx @shopware/api-gen loadSchema --apiType=admin --filename=adminApiSchema.json | ||
``` | ||
|
||
Remember to add `.env` file in order to authenticate with Shopware instance. | ||
|
||
```bash | ||
OPENAPI_JSON_URL="https://your-shop-instance.shopware.store" | ||
OPENAPI_ACCESS_KEY="YOUR_STORE_API_ACCESS_KEY" | ||
SHOPWARE_ADMIN_USERNAME="[email protected]" | ||
SHOPWARE_ADMIN_PASSWORD="my-password" | ||
``` | ||
|
||
<!-- AUTO GENERATED CHANGELOG --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.