openapi-python-client
openapi-python-client copied to clipboard
Support influxdata‘s openapi
Is your feature request related to a problem? Please describe.
https://github.com/influxdata/openapi
PS E:\PythonLibs\etcd\ht_ncp\ncp\test\influxdb_test\openapi-master\src> openapi-python-client generate --path .\oss.yml
Generating influx-oss-api-service-client
Warning(s) encountered while generating. Client was generated, but some pieces may be missing
Unable to parse this part of your OpenAPI document:
Reference schemas are not supported.
Reference(ref='./common/schemas/Authorization.yml')
Unable to parse this part of your OpenAPI document:
Reference schemas are not supported.
Reference(ref='./common/schemas/AuthorizationPostRequest.yml')
Unable to parse this part of your OpenAPI document:
Reference schemas are not supported.
Reference(ref='./common/schemas/Authorizations.yml')
Unable to parse this part of your OpenAPI document:
Reference schemas are not supported.
Reference(ref='./common/schemas/Permission.yml')
Unable to parse this part of your OpenAPI document:
Reference schemas are not supported.
Reference(ref='./common/schemas/Resource.yml')
Unable to parse this part of your OpenAPI document:
Reference schemas are not supported.
Reference(ref='./common/schemas/User.yml')
Unable to parse this part of your OpenAPI document:
Reference schemas are not supported.
Reference(ref='./common/schemas/Users.yml')
Unable to parse this part of your OpenAPI document:
Reference schemas are not supported.
Reference(ref='./common/schemas/OnboardingRequest.yml')
Unable to parse this part of your OpenAPI document:
Reference schemas are not supported.
Reference(ref='./common/schemas/OnboardingResponse.yml')
Unable to parse this part of your OpenAPI document:
Reference schemas are not supported.
Reference(ref='./common/schemas/Variable.yml')
Unable to parse this part of your OpenAPI document:
Reference schemas are not supported.
Reference(ref='./common/schemas/Variables.yml')
I believe this will be covered by #367
I tried https://github.com/P1sec/openapi-python-client/tree/feature/add_remote_reference_support, but it does not work.
generate --path D:\PythonDev\influxdb_test\openapi-master\src\oss.yml
File "C:\Users\jhong\Python\Pic\openapi_test\a.py", line 3, in <module>
app()
File "c:\Python39\Lib\site-packages\typer\main.py", line 214, in __call__
return get_command(self)(*args, **kwargs)
File "c:\Python39\Lib\site-packages\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "c:\Python39\Lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "c:\Python39\Lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\Python39\Lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\Python39\Lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "c:\Python39\Lib\site-packages\typer\main.py", line 497, in wrapper
return callback(**use_params) # type: ignore
File "c:\Python39\Lib\site-packages\openapi_python_client\cli.py", line 139, in generate
errors = create_new_client(
File "c:\Python39\Lib\site-packages\openapi_python_client\__init__.py", line 291, in create_new_client
project = _get_project_for_url_or_path(
File "c:\Python39\Lib\site-packages\openapi_python_client\__init__.py", line 268, in _get_project_for_url_or_path
data_dict = _get_document(url=url, path=path)
File "c:\Python39\Lib\site-packages\openapi_python_client\__init__.py", line 331, in _get_document
result = resolver.resolve()
File "c:\Python39\Lib\site-packages\openapi_python_client\resolver\schema_resolver.py", line 56, in resolve
self._resolve_schema_references(self._parent_path, root_schema, external_schemas, errors, recursive)
File "c:\Python39\Lib\site-packages\openapi_python_client\resolver\schema_resolver.py", line 87, in _resolve_schema_references
logging.exception(f"Failed to gather external reference data of {ref.value} from {path}")
File "c:\Python39\Lib\logging\__init__.py", line 2072, in exception
error(msg, *args, exc_info=exc_info, **kwargs)
File "c:\Python39\Lib\logging\__init__.py", line 2064, in error
root.error(msg, *args, **kwargs)
File "c:\Python39\Lib\logging\__init__.py", line 67, in error
File "c:\Python39\Lib\logging\__init__.py", line 1857, in _LogErrorReplacement
File "c:\Python39\Lib\site-packages\openapi_python_client\resolver\schema_resolver.py", line 80, in _resolve_schema_references
external_schemas[path] = self._fetch_remote_reference(path)
File "c:\Python39\Lib\site-packages\openapi_python_client\resolver\schema_resolver.py", line 122, in _fetch_remote_reference
res = self._fetch_remote_file_path(Path(abs_path))
File "c:\Python39\Lib\site-packages\openapi_python_client\resolver\schema_resolver.py", line 128, in _fetch_remote_file_path
return DataLoader.load(str(path), path.read_bytes())
File "c:\Python39\Lib\pathlib.py", line 1249, in read_bytes
with self.open(mode='rb') as f:
File "c:\Python39\Lib\pathlib.py", line 1242, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "c:\Python39\Lib\pathlib.py", line 1110, in _opener
return self._accessor.open(self, flags, mode)
builtins.FileNotFoundError: [Errno 2] No such file or directory: 'D:\\PythonDev\\influxdb_test\\openapi-master\\src\\oss\\paths\\oss\\paths\\ready.yml'
It looks like #367 has been closed due to other parallel attempts. Have any of those been merged?
Tracked in #804 (no current effort to complete it, as far as I know)