Skip to content

feat: limit @nexus.api-omit to some targets - #84

Closed
moetemp wants to merge 1 commit into
moe/up/python-rpc-optionsfrom
moe/up/source-targets
Closed

moetemp wants to merge 1 commit into
moe/up/python-rpc-optionsfrom
moe/up/source-targets

Conversation

@moetemp

@moetemp moetemp commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

What changed?

This PR lets @nexus.api-omit omit a field from some targets only.

/// @nexus.api-omit targets="workflow"
/// @nexus.source targets="client" python="client_writer()"
writer: option<stream-writer>,
  • @nexus.api-omit targets="workflow" drops the field from the Workflow API only. Here the client target fills it from its own source.
  • A required field can be API-omitted only if it's a list<T>. A Python, TypeScript or .NET call that omits it sends it empty.
  • The TypeScript model keeps a sourced field's @nexus.name, its optionality and its Long type.

In the stream sample, the Workflow read takes no last.

Why?

A Workflow read can't take last, since replay needs a fixed range, while a client read can.

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

Python, TypeScript and .NET tests check the filled requests, and fixtures cover the refused combinations.

@moetemp

moetemp commented Oct 30, 2026

Copy link
Copy Markdown
Owner Author

Closing. temporalio#344 already lets @nexus.source name its targets. A source that differs per context can use one helper that checks where it runs, with targets="workflow,client". Letting a source read the definition of a create moves to a small PR on temporalio#346 later.

@moetemp moetemp closed this Oct 30, 2026
@moetemp

moetemp commented Oct 30, 2026

Copy link
Copy Markdown
Owner Author

Reopened. On top of temporalio#346 we may still need three of its rules: the private request methods fill unset sources, a source can read a create's definition, and @nexus.api-omit can name a target. It needs a rework onto temporalio#346 first.

@moetemp moetemp reopened this Oct 30, 2026
@moetemp
moetemp force-pushed the moe/up/source-targets branch from 0b8405f to f76c7e1 Compare October 31, 2026 13:08
@moetemp moetemp changed the title feat: let @nexus.source and @nexus.api-omit name their target feat: give a field a source or an api-omit for each target Oct 31, 2026
@moetemp
moetemp force-pushed the moe/up/source-targets branch from f76c7e1 to b020739 Compare November 3, 2026 15:22
@moetemp
moetemp force-pushed the moe/up/python-rpc-options branch 2 times, most recently from 1aa317f to dc14c2d Compare November 4, 2026 09:34
@moetemp
moetemp force-pushed the moe/up/source-targets branch from b020739 to bf06cd9 Compare November 4, 2026 09:34
@moetemp
moetemp force-pushed the moe/up/python-rpc-options branch from dc14c2d to d6c9b34 Compare November 5, 2026 05:19
@moetemp
moetemp force-pushed the moe/up/source-targets branch from bf06cd9 to 41d2f1d Compare November 5, 2026 05:19
@moetemp moetemp changed the title feat: give a field a source or an api-omit for each target feat: limit @nexus.api-omit to some targets Nov 5, 2026
@moetemp
moetemp force-pushed the moe/up/python-rpc-options branch from d6c9b34 to 84e4b1a Compare November 5, 2026 07:27
@moetemp
moetemp force-pushed the moe/up/source-targets branch from 41d2f1d to 2ece8b5 Compare November 5, 2026 07:27
A field can leave the API of one target and take a source in another. A call of a target that omits a required list sends it empty.
@moetemp
moetemp force-pushed the moe/up/source-targets branch from 2ece8b5 to d7b69f0 Compare November 5, 2026 22:22
@moetemp
moetemp force-pushed the moe/up/python-rpc-options branch from 84e4b1a to cddac5b Compare November 5, 2026 22:22
@moetemp

moetemp commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Moved to temporalio#371, on main.

@moetemp moetemp closed this Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant