-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make value handling methods more discoverable in the documentation #695
Comments
Just to copy some additional thoughts from an outside-of-GitHub conversation:
The navigation then might become something like: Handling Data
Each of the new Attributes, Blocks, and Built-In Types pages could then provide real world code examples, such as using // Logic in this example is applicable to any data source, provider, or resource method
// that needs to convert data into a types.Map.
func (r ThingResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
// ... API handling logic ...
// Typically this would be an existing field from an API SDK type,
// however this example shows an inline variable definition for brevity.
var apiMap map[string]string
tfMap, diags := types.MapValueFrom(ctx, types.String, apiMap)
resp.Diagnostics.Append(diags...)
if resp.Diagnostics.HasError() {
return
}
// ... resp.State.Set() or resp.State.SetAttribute() logic using tfMap ...
} |
I would also really appreciate this as I struggled for about thirty minutes yesterday to determine proper usage for That example at the end of the comment would be very helpful (especially because I thought at first I needed to use |
…and examples Reference: #695 This change creates new attributes, blocks, and types sections, each with full information about each type. The attribute/block pages are cross-linked with their associated type pages and vice-versa. Web platform changes to redirect the removed pages to existing pages will be handled separately on deployment.
…and examples (#822) Reference: #695 This change creates new attributes, blocks, and types sections, each with full information about each type. The attribute/block pages are cross-linked with their associated type pages and vice-versa. Web platform changes to redirect the removed pages to existing pages will be handled separately on deployment.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Module version
N/A
Use-cases
As a new framework developer, I would like to easily find the methods for converting go native types to their equivalent
type
values.The current documenation for attributes is very long and the full contents are not listed completely on the "On this page".
Attempted Solutions
N/A
Proposal
types
Conventions" section at the top of the page describing that each type has a "types..IsNull"/"types.ValueFrom"/etc.type
has an entry in a TOC.References
The text was updated successfully, but these errors were encountered: