Skip to content

Adding ability to set default client configuration during generation#194

Closed
dcarbone wants to merge 5 commits into
mainfrom
feature/version-http-config
Closed

Adding ability to set default client configuration during generation#194
dcarbone wants to merge 5 commits into
mainfrom
feature/version-http-config

Conversation

@dcarbone

Copy link
Copy Markdown
Owner

No description provided.

@dcarbone dcarbone self-assigned this May 14, 2026
@dcarbone dcarbone marked this pull request as ready for review May 14, 2026 13:59
Copilot AI review requested due to automatic review settings May 14, 2026 13:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for defining a default FHIR API client configuration during generation, wiring it through generated version configuration and client construction.

Changes:

  • Adds clientConfig handling to VersionDefaultConfig and generated VersionConfig.
  • Adds generated client factory support via VersionClient::fromVersion().
  • Adds tests for default client config behavior and refreshes copyright years.

Reviewed changes

Copilot reviewed 66 out of 66 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/VersionDefaultConfigTest.php Adds client config tests.
template/versions/core/class_version.php Passes generated client config into version config.
template/versions/core/class_version_client.php Adds fromVersion() factory.
template/tests/core/versions/test_class_version_config.php Adds generated version config client tests.
template/tests/core/mock/class_mock_version_config.php Updates mock interface implementation.
template/core/versions/interface_version_config.php Adds getClientConfig().
template/core/versions/class_version_config.php Adds client config storage and setters.
src/Version/VersionDefaultConfig.php Adds generation-time client config parsing.
src/Version/SourceMetadata.php Copyright update.
src/Version/Definition/TypeTestFiles.php Copyright update.
src/Version/Definition/Types.php Copyright update.
src/Version/Definition/TypePropertyDecorator.php Copyright update.
src/Version/Definition/TypeExtractor.php Copyright update.
src/Version/Definition/TypeDecorator.php Copyright update.
src/Version/Definition/TypeDecorationValidator.php Copyright update.
src/Version/Definition/Type.php Copyright update.
src/Version/Definition/SourceTrait.php Copyright update.
src/Version/Definition/Property.php Copyright update.
src/Version/Definition/Properties.php Copyright update.
src/Version/Definition/Enumeration/EnumerationValue.php Copyright update.
src/Version/Definition/Enumeration.php Copyright update.
src/Version/Definition/DocumentationTrait.php Copyright update.
src/Version/Definition/Decorator/UnionElementTypeDecorator.php Copyright update.
src/Version/Definition/Decorator/SimpleTypeElementTypeDecorator.php Copyright update.
src/Version/Definition/Decorator/SimpleTypeElementPropertyDecorator.php Copyright update.
src/Version/Definition/Decorator/SimpleContentElementTypeDecorator.php Copyright update.
src/Version/Definition/Decorator/SequenceElementTypeDecorator.php Copyright update.
src/Version/Definition/Decorator/RestrictionElementTypeDecorator.php Copyright update.
src/Version/Definition/Decorator/ExtensionElementTypeDecorator.php Copyright update.
src/Version/Definition/Decorator/ElementElementTypeDecorator.php Copyright update.
src/Version/Definition/Decorator/ComplexTypeElementTypeDecorator.php Copyright update.
src/Version/Definition/Decorator/ComplexContentElementTypeDecorator.php Copyright update.
src/Version/Definition/Decorator/ChoiceElementTypeDecorator.php Copyright update.
src/Version/Definition/Decorator/ChoiceElementElementPropertyDecorator.php Copyright update.
src/Version/Definition/Decorator/AttributeElementTypeDecorator.php Copyright update.
src/Version/Definition/Decorator/AnyElementTypeDecorator.php Copyright update.
src/Version/Definition/Decorator/AnnotationElementTypeDecorator.php Copyright update.
src/Version/Definition/Decorator/AnnotationElementPropertyTypeDecorator.php Copyright update.
src/Version/Definition.php Copyright update.
src/Version.php Copyright update.
src/Utilities/XMLValueLocationUtils.php Copyright update.
src/Utilities/TypeHintUtils.php Copyright update.
src/Utilities/NameUtils.php Copyright update.
src/Utilities/ImportUtils.php Copyright update.
src/Utilities/FileUtils.php Copyright update.
src/Utilities/ExceptionUtils.php Copyright update.
src/Utilities/DocumentationUtils.php Copyright update.
src/Utilities/CopyrightUtils.php Copyright update.
src/Render/Templates.php Copyright update.
src/LogLevel.php Copyright update.
src/Logger.php Copyright update.
src/Enum/TypeKindEnum.php Copyright update.
src/Enum/PropertyUseEnum.php Copyright update.
src/Enum/PrimitiveTypeEnum.php Copyright update.
src/Enum/ElementNameEnum.php Copyright update.
src/Enum/AttributeNameEnum.php Copyright update.
src/CoreFiles.php Copyright update.
src/CoreFile.php Copyright update.
src/Config/VersionConfig.php Copyright update.
src/Config.php Copyright update.
src/Builder/TypeBuilder.php Copyright update.
src/Builder/Imports.php Copyright update.
src/Builder/Import.php Copyright update.
src/Builder.php Copyright update.
files/funcs.php Copyright update.
files/constants.php Copyright update.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread template/core/versions/class_version_config.php Outdated
Comment thread template/core/versions/class_version_config.php
Comment thread template/versions/core/class_version_client.php

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 67 out of 67 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

template/tests/versions/core/test_class_version_client.php:106

  • This assigned $client is never used, so the test does not actually verify anything about the VersionClient returned by fromVersion() beyond the config already stored on $version. Either assert on the returned client or remove the assignment to avoid a misleading success-path test.

Comment thread template/core/versions/interface_version_config.php
Comment thread template/versions/core/class_version.php
Comment thread template/versions/core/class_version_client.php Outdated
Comment thread template/tests/versions/core/test_class_version_client.php Outdated
Comment thread template/core/versions/class_version_config.php

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 67 out of 67 changed files in this pull request and generated 2 comments.

Comment on lines +200 to +210
if (!array_key_exists('address', $config) || '' === trim((string)$config['address'])) {
throw new \InvalidArgumentException(
'Client config must include a non-empty "address" key.'
);
}
foreach (self::_CLIENT_CONFIG_KEYS as $k) {
if (!array_key_exists($k, $config)) {
continue;
}
$this->_clientConfig[$k] = match ($k) {
'address' => (string)$config[$k],
Comment on lines +153 to +155
$this->_clientConfig = new <?php echo PHPFHIR_CLIENT_CLASSNAME_CONFIG; ?>(
address: $config['address'],
defaultFormat: isset($config['defaultFormat']) ? <?php echo $serializeFormatEnum; ?>::from($config['defaultFormat']) : <?php echo $serializeFormatEnum; ?>::XML,
@dcarbone

Copy link
Copy Markdown
Owner Author

Eh, this is too compromised. Closing.

@dcarbone dcarbone closed this May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants