Skip to content

Commit ec7fffe

Browse files
committed
Add API deprecation guidelines
1 parent 93d551b commit ec7fffe

1 file changed

Lines changed: 241 additions & 1 deletion

File tree

.github/prompts/author-api-docs.prompt.md

Lines changed: 241 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ Before beginning the documentation process, first ask the author which documenta
1515
**Please select your documentation scenario:**
1616
1. Author fresh APIs / fresh API changes to beta
1717
2. Promote APIs from beta to v1.0
18+
3. Document deprecated APIs
1819

19-
**Please respond with 1 or 2 to proceed.**
20+
**Please respond with 1, 2, or 3 to proceed.**
2021

2122
Once the author responds, follow the appropriate workflow below.
2223

24+
**Note:** Scenario 3 (deprecation) can be combined with Scenario 1 or 2. If the Summary of API changes includes both deprecation and other changes (new APIs, promotions, updates), the workflow will handle mixed scenarios by processing non-deprecation tasks first, then applying deprecation documentation.
25+
2326
---
2427

2528
## Common Setup and Processes
@@ -514,6 +517,243 @@ Remove "(preview)" from TOC entries as applicable:
514517

515518
---
516519

520+
## Scenario 3: Document deprecated APIs
521+
522+
### Prerequisites
523+
524+
**See [Common Setup: temp-docstubs Folder](#common-setup-temp-docstubs-folder)** for instructions on setting up the temp-docstubs folder.
525+
526+
For this scenario, the author should add these files to `temp-docstubs`:
527+
- Summary of API changes documenting what is being deprecated
528+
- Autogenerated changelog file (changelog_*.json) if applicable
529+
- Any supporting documentation about the deprecation (blog post URLs, alternative APIs, migration guidance)
530+
531+
### Understanding API deprecation
532+
533+
A feature that is no longer in active development is _deprecated_. Deprecations are announced via blog posts and corresponding documentation updates. The deprecation announcement includes:
534+
- A timeline (deprecation period) after which the feature is removed from the service or the service is retired
535+
- Alternative features or workarounds for existing apps
536+
- Migration guidance and timelines
537+
538+
**Important:** Deprecation is not always a standalone process. An API can be deprecated in the same set of changes that add new APIs. For example:
539+
- Deprecating one property while adding a replacement property
540+
- Deprecating a method while adding a new method
541+
- Deprecating a resource while adding an alternative resource
542+
- Combining deprecation with other API additions or updates
543+
544+
The Summary of API changes may contain a mix of deprecation and new API documentation tasks.
545+
546+
**API artifacts that can be deprecated:**
547+
- Resources (Entity Types and Complex Types)
548+
- Methods (CRUD operations, actions, functions)
549+
- Properties
550+
- Relationships (Navigation Properties)
551+
- Parameters (path, function, or query parameters)
552+
- Enumerations
553+
554+
### Inputs required
555+
556+
**Summary of API changes (required):**
557+
- Detailed description of what is being deprecated, which files to change, alternatives/workarounds, milestone dates, and blog post links
558+
- May include both deprecation and non-deprecation changes (mixed scenarios)
559+
- **Location:** `temp-docstubs` folder
560+
561+
**Autogenerated changelog (optional):**
562+
- JSON file if provided
563+
- **Location:** `temp-docstubs` folder
564+
565+
### Key principles
566+
567+
- **Customer clarity:** Clearly indicate what is deprecated and provide alternatives/workarounds
568+
- **Implicit deprecation:** Deprecating a resource implies all its properties, methods, and relationships are deprecated (no need to mark each individually)
569+
- **Type definitions:** Deprecating a resource does NOT deprecate child type definitions unless explicitly stated
570+
571+
### Common deprecation patterns
572+
573+
**Deprecation banner (applies to resources, methods, enumerations with own topics):**
574+
- Place immediately after namespace declaration (before beta disclaimer if beta)
575+
- Format as CAUTION alert
576+
- Include: what's deprecated, milestone date, alternative/workaround, blog post link
577+
- Use include files stored in `api-reference/includes/` for consistency across topics
578+
579+
**Example:**
580+
```markdown
581+
> [!CAUTION]
582+
> The Outlook tasks API is deprecated and will stop returning data on August 20, 2022. Use the [To Do API](https://learn.microsoft.com/graph/api/resources/todo-overview?view=graph-rest-1.0) instead.
583+
```
584+
585+
**Table updates (applies to properties, relationships, parameters, enum members):**
586+
- Add "(deprecated)" to the name in the first column
587+
- Update description with alternative/workaround
588+
- Move to end of table, grouped alphabetically with other deprecated items
589+
- Do NOT add "(deprecated)" to JSON representation sections (causes validation errors)
590+
591+
**TOC updates:**
592+
- Add `toc.title` attribute in YAML front matter with "(deprecated)" OR
593+
- Include "(deprecated)" inside link text in Methods tables
594+
595+
---
596+
597+
### To deprecate a resource
598+
599+
1. **Update resource topic:**
600+
- Add "(deprecated)" to H1 title: `# user resource type (deprecated)`
601+
- Add deprecation banner (see common pattern above)
602+
- Add `toc.title` with "(deprecated)" to YAML front matter
603+
604+
2. **Mark child methods:**
605+
- Add "(deprecated)" to H1 title in each method topic
606+
- Add deprecation banner to each method topic
607+
608+
3. **Update references in other resources:**
609+
- Add "(deprecated)" to properties/relationships/methods that reference the deprecated resource type
610+
611+
4. **Do NOT mark child type definitions as deprecated** (only if explicitly stated in Summary)
612+
613+
---
614+
615+
### To deprecate a method
616+
617+
1. **Update method topic:**
618+
- Add "(deprecated)" to H1 title: `# Delete user (deprecated)`
619+
- Add deprecation banner with alternative/workaround
620+
621+
2. **Update parent resource Methods table:**
622+
- Add "(deprecated)" inside link text: `[Delete (deprecated)](user-delete.md)`
623+
- Move to end of table (grouped alphabetically with other deprecated methods)
624+
- Include alternative in description column
625+
626+
---
627+
628+
### To deprecate a property
629+
630+
1. **Update resource Properties table:**
631+
- Add "(deprecated)" to property name, update description with alternative, move to end (see common pattern)
632+
633+
2. **Update API method topics:**
634+
- Add "(deprecated)" in Request body tables (POST, PATCH, PUT) if property is used
635+
- Update Response examples: remove property if no longer returned, keep if still returned
636+
637+
---
638+
639+
### To deprecate a relationship
640+
641+
1. **Update resource Relationships table:**
642+
- Add "(deprecated)" to relationship name, update description, move to end (see common pattern)
643+
644+
2. **Deprecate corresponding methods:**
645+
- Methods including the navigation property as a segment are also deprecated
646+
- Follow method deprecation workflow for each affected method
647+
648+
---
649+
650+
### To deprecate a parameter
651+
652+
**Update parameter table in method topic:**
653+
- Add "(deprecated)" to parameter name, specify whether to ignore or use alternative, move to end (see common pattern)
654+
655+
---
656+
657+
### To deprecate an enumeration
658+
659+
1. **Update enumeration definition:**
660+
- **In enums.md or parent resource:** Add "(deprecated)" to section title: `### emailType values (deprecated)`
661+
- **In own topic (rare):** Add "(deprecated)" to H1 title and add deprecation banner
662+
663+
2. **Update properties using the enum:**
664+
- Update type, description, possible values with alternative/workaround
665+
666+
---
667+
668+
### To deprecate enumeration members
669+
670+
1. **Update member table:**
671+
- Add "(deprecated)" to member name, specify alternative, move to end (see common pattern)
672+
673+
2. **Update property descriptions:**
674+
- Note which values are deprecated and provide guidance
675+
676+
---
677+
678+
### Supporting updates
679+
680+
**Changelog:** Change type: "Deprecation". Include API set/entities, link to topics and blog post. See [Common Process: Updating the Changelog](#common-process-updating-the-changelog).
681+
682+
**What's New:** Describe deprecation, link to deprecated API and alternative, link to blog post. See [Common Process: Updating What's New](#common-process-updating-whats-new).
683+
684+
---
685+
686+
### Mixed scenarios
687+
688+
When combining deprecation with new APIs/promotions:
689+
1. Categorize changes (deprecation, new, promotion, updates)
690+
2. Process non-deprecation tasks first (ensures alternatives are documented)
691+
3. Process deprecation tasks, referencing newly created alternatives
692+
4. Update changelog with both deprecation and addition/change entries
693+
694+
---
695+
696+
### Version-specific notes
697+
698+
- **Beta:** Banner after namespace, before beta disclaimer; keep beta disclaimer; use `?view=graph-rest-beta&preserve-view=true`
699+
- **v1.0:** Banner after namespace; no query strings in links
700+
- **Both:** Apply to both versions; may have different milestone dates/alternatives
701+
702+
---
703+
704+
### Quality checklist
705+
706+
**Common to all deprecations:**
707+
- [ ] "(deprecated)" added to H1 titles or table entries as appropriate
708+
- [ ] Deprecation banners added (resources, methods, enums with own topics): CAUTION alert after namespace, includes milestone/alternative/blog link
709+
- [ ] Include files used for banner text (best practice)
710+
- [ ] TOC updated: `toc.title` in YAML or "(deprecated)" in link text
711+
- [ ] Alternatives/workarounds provided and linked
712+
- [ ] "(deprecated)" NOT added to JSON representation sections
713+
714+
**Table entries (properties, relationships, parameters, enum members):**
715+
- [ ] "(deprecated)" added to name in first column
716+
- [ ] Description updated with alternative
717+
- [ ] Moved to end of table (grouped alphabetically with other deprecated items)
718+
719+
**Resources:**
720+
- [ ] All child methods marked deprecated with banners
721+
- [ ] References in other resources marked "(deprecated)"
722+
- [ ] Child type definitions NOT marked deprecated (unless explicitly stated)
723+
724+
**Relationships:**
725+
- [ ] Corresponding methods with navigation property as segment also deprecated
726+
727+
**Properties:**
728+
- [ ] "(deprecated)" added in Request body tables (POST/PATCH/PUT) if applicable
729+
- [ ] Response examples updated (removed if no longer returned, kept if still returned)
730+
- [ ] Description accuracy reviewed (e.g., "required" removed)
731+
732+
**Enumerations:**
733+
- [ ] Section title or H1 title updated
734+
- [ ] Properties using enum updated with alternatives
735+
736+
**Supporting updates:**
737+
- [ ] Changelog: Change type "Deprecation", links to topics/blog
738+
- [ ] What's New: describes deprecation, links to API/alternative/blog
739+
740+
**Mixed scenarios:**
741+
- [ ] Non-deprecation tasks processed first
742+
- [ ] Deprecation references newly created alternatives
743+
- [ ] Changelog includes both deprecation and addition entries
744+
745+
**Version-specific:**
746+
- [ ] Beta: Banner before beta disclaimer; beta disclaimer retained; links include `?view=graph-rest-beta&preserve-view=true`
747+
- [ ] V1.0: No query strings in links
748+
- [ ] Both versions: Applied to both with version-specific formatting
749+
750+
**Final:**
751+
- [ ] All Summary items addressed
752+
- [ ] No markdown lint errors
753+
- [ ] Summary provided to author
754+
755+
---
756+
517757
## Categories of changes (Scenario 1 only)
518758

519759
Based on the summary of API changes, the work will fall into two categories:

0 commit comments

Comments
 (0)