Skip to content

Commit

Permalink
safer handling of schema->info->title
Browse files Browse the repository at this point in the history
  • Loading branch information
battis committed Feb 13, 2024
1 parent 5a76821 commit 2e463ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
"email": "sbattis@groton.org"
}
],
"repositories": [
{
"type": "path",
"url": "../openapi-client-generator"
}
],
"require": {
"groton-school/oauth2-blackbaudsky": "^0.2.3",
"psr/simple-cache": "^3.0"
Expand Down
4 changes: 2 additions & 2 deletions scripts/map
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ require __DIR__ . "/../vendor/autoload.php";
class BlackbaudMap extends Map {
protected function getNamespaceFromSpec(string $specPath, OpenApi $spec, string $baseNamespace): string
{
return Path::join("\\",[$baseNamespace, $spec->info->title]);
return Path::join("\\",[$baseNamespace, preg_replace("/[^a-z0-9_]+/i", "", $spec->info->title)]);
}

protected function getBasePathFromSpec(string $specPath, OpenApi $spec, string $basePath): string
{
return Path::join($basePath, $spec->info->title);
return Path::join($basePath, preg_replace("/[^a-z0-9_]+/i", "", $spec->info->title));
}
}

Expand Down

0 comments on commit 2e463ca

Please sign in to comment.