feat: add default api section in manifest#40
Conversation
|
Thank you @MohamedBenTaher , what is the reason we would add it by default even if the value is set to false ? |
|
yes , you are right @skokaina , if the user sets it to false then it shouldn't be present , it should be there only if the user sets it to true and no custom value for the api is provided |
…iPort is set without apiType
…to consider apiPort alongside apiType
|
Small inconsistency worth flagging: |
Worth reporting it as a github issue indeed, well spotted |
|
thanks @MohamedBenTaher for your first contribution, i will merge, however please open an issue for the small inconsistency in ports it will help tracking and fixing it |
|
Thanks a lot @skokaina , I will definitely open an issue for it now ! |
This pull request updates the manifest generation logic and its tests to ensure that when the
includeApioption is enabled but noapiTypeis specified, a default API section with sensible defaults is included in the generated manifest. It also adds comprehensive tests to verify this behavior.Manifest generation improvements:
generateDefaultApiSectionfunction ininit-helpers.tsto generate a default API section withtype: rest,port: 8000,pathPrefix: /v1, andcorsOrigins: ["*"]whenincludeApiis true andapiTypeis not set.generateManifestto use the new default API section logic, falling back to the custom API section only whenapiTypeis provided.Testing enhancements:
init.test.tsto check for the presence and correctness of the default API section whenincludeApiis true andapiTypeis not set, and to confirm its absence whenincludeApiis false. [1] [2]This pull request updates the manifest generation logic and associated tests to ensure that anapisection is always present in the generated manifest, even when theincludeApioption is set to false. The defaultapisection uses standard values for its fields. Several tests are updated and new tests are added to verify this behavior.Manifest generation logic changes:
generateDefaultApiSectionfunction ininit-helpers.tsto produce a defaultapisection withtype: rest,port: 8000,pathPrefix: /v1, andcorsOrigins: ["*"]whenincludeApiis false.generateManifestto always include anapisection: ifincludeApiis true, it uses the customized section; otherwise, it uses the default section.Test updates and additions:
init.test.tsto expect the defaultapisection whenincludeApiis false, including checks for the default field values. [1] [2]apisection is always present and contains the expected values, even with all feature flags set to false.