Skip to content

Add API client generation and fix IsEditable bug#6

Open
RutgerDijk wants to merge 3 commits into
theFactore:mainfrom
RutgerDijk:feature/Add-api-generator
Open

Add API client generation and fix IsEditable bug#6
RutgerDijk wants to merge 3 commits into
theFactore:mainfrom
RutgerDijk:feature/Add-api-generator

Conversation

@RutgerDijk
Copy link
Copy Markdown

Summary

  • Fix missing [Column("IsEditable")] attribute on IPAccessEntry, which caused NOT NULL constraint failures when saving new IP entries
  • Add openapi-typescript-codegen tooling to regenerate the TypeScript API client from the backend Swagger spec (npm run generate:api)
  • Regenerate API client to match current backend endpoints and fix resulting frontend type errors
  • Add client README (Dutch) documenting scripts and API generation workflow

Test plan

  • Add a new IP address in the backoffice — should save without errors
  • Edit and delete existing entries — should work as before
  • Run npm run generate:api with the backend running — should regenerate client/src/api/ without errors
  • Run npm run build in client/ — should compile without type errors

IPAccessEntry.IsEditable lacked the [Column] attribute, so NPoco
(with [ExplicitColumns]) never sent it to the database on insert,
causing a NOT NULL constraint violation. Also set IsEditable = true
for new entries in the Save method.
- Add openapi-typescript-codegen and generate:api script
- Regenerate TypeScript API client from current Swagger spec
- Fix frontend type errors from updated IPAccessEntry model
- Add client README (Dutch)
@timoschraa
Copy link
Copy Markdown
Contributor

Nice @RutgerDijk ! This will help us move on 👌 @JHHessels will you be able to merge this PR so we can use the API generation for upcoming PR's?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants